@datapos/datapos-development 0.3.397 → 0.3.400
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { promises as at, existsSync as
|
|
2
|
-
import { nanoid as
|
|
3
|
-
import { contextConfigSchema as
|
|
1
|
+
import { promises as at, existsSync as Qi } from "node:fs";
|
|
2
|
+
import { nanoid as Ji } from "nanoid";
|
|
3
|
+
import { contextConfigSchema as Yi, connectorConfigSchema as Zi, CONNECTOR_SOURCE_OPERATIONS as ts, CONNECTOR_DESTINATION_OPERATIONS as es, presenterConfigSchema as is } from "@datapos/datapos-shared";
|
|
4
4
|
import te from "node:path";
|
|
5
|
-
import { promisify as
|
|
6
|
-
import { exec as
|
|
7
|
-
import { fileURLToPath as ri, URL as
|
|
5
|
+
import { promisify as ss } from "node:util";
|
|
6
|
+
import { exec as rs, spawn as as } from "node:child_process";
|
|
7
|
+
import { fileURLToPath as ri, URL as ns } from "node:url";
|
|
8
8
|
let xe;
|
|
9
9
|
// @__NO_SIDE_EFFECTS__
|
|
10
|
-
function
|
|
10
|
+
function os(t) {
|
|
11
11
|
return {
|
|
12
12
|
lang: t?.lang ?? xe?.lang,
|
|
13
13
|
message: t?.message,
|
|
@@ -17,7 +17,7 @@ function ns(t) {
|
|
|
17
17
|
}
|
|
18
18
|
// @__NO_SIDE_EFFECTS__
|
|
19
19
|
function Ee(t, e, s) {
|
|
20
|
-
const a = t["~run"]({ value: e }, /* @__PURE__ */
|
|
20
|
+
const a = t["~run"]({ value: e }, /* @__PURE__ */ os(s));
|
|
21
21
|
return {
|
|
22
22
|
typed: a.typed,
|
|
23
23
|
success: !a.issues,
|
|
@@ -25,17 +25,17 @@ function Ee(t, e, s) {
|
|
|
25
25
|
issues: a.issues
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
var
|
|
28
|
+
var hs = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239], ai = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191], us = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", ni = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ꟑꟑꟓꟕ-ꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", ve = {
|
|
29
29
|
3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
|
|
30
30
|
5: "class enum extends super const export import",
|
|
31
31
|
6: "enum",
|
|
32
32
|
strict: "implements interface let package private protected public static yield",
|
|
33
33
|
strictBind: "eval arguments"
|
|
34
|
-
}, ge = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",
|
|
34
|
+
}, ge = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this", cs = {
|
|
35
35
|
5: ge,
|
|
36
36
|
"5module": ge + " export import",
|
|
37
37
|
6: ge + " const class extends export import super"
|
|
38
|
-
},
|
|
38
|
+
}, ps = /^in(stanceof)?$/, ls = new RegExp("[" + ni + "]"), fs = new RegExp("[" + ni + us + "]");
|
|
39
39
|
function Pe(t, e) {
|
|
40
40
|
for (var s = 65536, a = 0; a < e.length; a += 2) {
|
|
41
41
|
if (s += e[a], s > t)
|
|
@@ -46,10 +46,10 @@ function Pe(t, e) {
|
|
|
46
46
|
return !1;
|
|
47
47
|
}
|
|
48
48
|
function ft(t, e) {
|
|
49
|
-
return t < 65 ? t === 36 : t < 91 ? !0 : t < 97 ? t === 95 : t < 123 ? !0 : t <= 65535 ? t >= 170 &&
|
|
49
|
+
return t < 65 ? t === 36 : t < 91 ? !0 : t < 97 ? t === 95 : t < 123 ? !0 : t <= 65535 ? t >= 170 && ls.test(String.fromCharCode(t)) : e === !1 ? !1 : Pe(t, ai);
|
|
50
50
|
}
|
|
51
51
|
function vt(t, e) {
|
|
52
|
-
return t < 48 ? t === 36 : t < 58 ? !0 : t < 65 ? !1 : t < 91 ? !0 : t < 97 ? t === 95 : t < 123 ? !0 : t <= 65535 ? t >= 170 &&
|
|
52
|
+
return t < 48 ? t === 36 : t < 58 ? !0 : t < 65 ? !1 : t < 91 ? !0 : t < 97 ? t === 95 : t < 123 ? !0 : t <= 65535 ? t >= 170 && fs.test(String.fromCharCode(t)) : e === !1 ? !1 : Pe(t, ai) || Pe(t, hs);
|
|
53
53
|
}
|
|
54
54
|
var O = function(e, s) {
|
|
55
55
|
s === void 0 && (s = {}), this.label = e, this.keyword = s.keyword, this.beforeExpr = !!s.beforeExpr, this.startsExpr = !!s.startsExpr, this.isLoop = !!s.isLoop, this.isAssign = !!s.isAssign, this.prefix = !!s.prefix, this.postfix = !!s.postfix, this.binop = s.binop || null, this.updateContext = null;
|
|
@@ -57,16 +57,16 @@ var O = function(e, s) {
|
|
|
57
57
|
function ot(t, e) {
|
|
58
58
|
return new O(t, { beforeExpr: !0, binop: e });
|
|
59
59
|
}
|
|
60
|
-
var ht = { beforeExpr: !0 },
|
|
60
|
+
var ht = { beforeExpr: !0 }, et = { startsExpr: !0 }, Lt = {};
|
|
61
61
|
function M(t, e) {
|
|
62
62
|
return e === void 0 && (e = {}), e.keyword = t, Lt[t] = new O(t, e);
|
|
63
63
|
}
|
|
64
64
|
var u = {
|
|
65
|
-
num: new O("num",
|
|
66
|
-
regexp: new O("regexp",
|
|
67
|
-
string: new O("string",
|
|
68
|
-
name: new O("name",
|
|
69
|
-
privateId: new O("privateId",
|
|
65
|
+
num: new O("num", et),
|
|
66
|
+
regexp: new O("regexp", et),
|
|
67
|
+
string: new O("string", et),
|
|
68
|
+
name: new O("name", et),
|
|
69
|
+
privateId: new O("privateId", et),
|
|
70
70
|
eof: new O("eof"),
|
|
71
71
|
// Punctuation token types.
|
|
72
72
|
bracketL: new O("[", { beforeExpr: !0, startsExpr: !0 }),
|
|
@@ -85,7 +85,7 @@ var u = {
|
|
|
85
85
|
template: new O("template"),
|
|
86
86
|
invalidTemplate: new O("invalidTemplate"),
|
|
87
87
|
ellipsis: new O("...", ht),
|
|
88
|
-
backQuote: new O("`",
|
|
88
|
+
backQuote: new O("`", et),
|
|
89
89
|
dollarBraceL: new O("${", { beforeExpr: !0, startsExpr: !0 }),
|
|
90
90
|
// Operators. These carry several kinds of properties to help the
|
|
91
91
|
// parser use them properly (the presence of these properties is
|
|
@@ -129,7 +129,7 @@ var u = {
|
|
|
129
129
|
_else: M("else", ht),
|
|
130
130
|
_finally: M("finally"),
|
|
131
131
|
_for: M("for", { isLoop: !0 }),
|
|
132
|
-
_function: M("function",
|
|
132
|
+
_function: M("function", et),
|
|
133
133
|
_if: M("if"),
|
|
134
134
|
_return: M("return", ht),
|
|
135
135
|
_switch: M("switch"),
|
|
@@ -140,21 +140,21 @@ var u = {
|
|
|
140
140
|
_while: M("while", { isLoop: !0 }),
|
|
141
141
|
_with: M("with"),
|
|
142
142
|
_new: M("new", { beforeExpr: !0, startsExpr: !0 }),
|
|
143
|
-
_this: M("this",
|
|
144
|
-
_super: M("super",
|
|
145
|
-
_class: M("class",
|
|
143
|
+
_this: M("this", et),
|
|
144
|
+
_super: M("super", et),
|
|
145
|
+
_class: M("class", et),
|
|
146
146
|
_extends: M("extends", ht),
|
|
147
147
|
_export: M("export"),
|
|
148
|
-
_import: M("import",
|
|
149
|
-
_null: M("null",
|
|
150
|
-
_true: M("true",
|
|
151
|
-
_false: M("false",
|
|
148
|
+
_import: M("import", et),
|
|
149
|
+
_null: M("null", et),
|
|
150
|
+
_true: M("true", et),
|
|
151
|
+
_false: M("false", et),
|
|
152
152
|
_in: M("in", { beforeExpr: !0, binop: 7 }),
|
|
153
153
|
_instanceof: M("instanceof", { beforeExpr: !0, binop: 7 }),
|
|
154
154
|
_typeof: M("typeof", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
|
|
155
155
|
_void: M("void", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
|
|
156
156
|
_delete: M("delete", { beforeExpr: !0, prefix: !0, startsExpr: !0 })
|
|
157
|
-
},
|
|
157
|
+
}, J = /\r\n?|\n|\u2028|\u2029/, oi = new RegExp(J.source, "g");
|
|
158
158
|
function Et(t) {
|
|
159
159
|
return t === 10 || t === 13 || t === 8232 || t === 8233;
|
|
160
160
|
}
|
|
@@ -167,10 +167,10 @@ function hi(t, e, s) {
|
|
|
167
167
|
}
|
|
168
168
|
return -1;
|
|
169
169
|
}
|
|
170
|
-
var Ie = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, W = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, ui = Object.prototype,
|
|
171
|
-
return
|
|
170
|
+
var Ie = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, W = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, ui = Object.prototype, ds = ui.hasOwnProperty, ms = ui.toString, Rt = Object.hasOwn || (function(t, e) {
|
|
171
|
+
return ds.call(t, e);
|
|
172
172
|
}), $e = Array.isArray || (function(t) {
|
|
173
|
-
return
|
|
173
|
+
return ms.call(t) === "[object Array]";
|
|
174
174
|
}), Ge = /* @__PURE__ */ Object.create(null);
|
|
175
175
|
function kt(t) {
|
|
176
176
|
return Ge[t] || (Ge[t] = new RegExp("^(?:" + t.replace(/ /g, "|") + ")$"));
|
|
@@ -178,13 +178,13 @@ function kt(t) {
|
|
|
178
178
|
function gt(t) {
|
|
179
179
|
return t <= 65535 ? String.fromCharCode(t) : (t -= 65536, String.fromCharCode((t >> 10) + 55296, (t & 1023) + 56320));
|
|
180
180
|
}
|
|
181
|
-
var
|
|
181
|
+
var ys = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, Ot = function(e, s) {
|
|
182
182
|
this.line = e, this.column = s;
|
|
183
183
|
};
|
|
184
184
|
Ot.prototype.offset = function(e) {
|
|
185
185
|
return new Ot(this.line, this.column + e);
|
|
186
186
|
};
|
|
187
|
-
var
|
|
187
|
+
var Kt = function(e, s, a) {
|
|
188
188
|
this.start = s, this.end = a, e.sourceFile !== null && (this.source = e.sourceFile);
|
|
189
189
|
};
|
|
190
190
|
function _e(t, e) {
|
|
@@ -292,7 +292,7 @@ var ee = {
|
|
|
292
292
|
// (non-standard) ParenthesizedExpression nodes
|
|
293
293
|
preserveParens: !1
|
|
294
294
|
}, Ke = !1;
|
|
295
|
-
function
|
|
295
|
+
function xs(t) {
|
|
296
296
|
var e = {};
|
|
297
297
|
for (var s in ee)
|
|
298
298
|
e[s] = t && Rt(t, s) ? t[s] : ee[s];
|
|
@@ -303,30 +303,30 @@ Defaulting to 2020, but this will stop working in the future.`)), e.ecmaVersion
|
|
|
303
303
|
return a.push(o);
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
|
-
return $e(e.onComment) && (e.onComment =
|
|
306
|
+
return $e(e.onComment) && (e.onComment = vs(e, e.onComment)), e;
|
|
307
307
|
}
|
|
308
|
-
function
|
|
309
|
-
return function(s, a, o,
|
|
308
|
+
function vs(t, e) {
|
|
309
|
+
return function(s, a, o, l, d, v) {
|
|
310
310
|
var g = {
|
|
311
311
|
type: s ? "Block" : "Line",
|
|
312
312
|
value: a,
|
|
313
313
|
start: o,
|
|
314
|
-
end:
|
|
314
|
+
end: l
|
|
315
315
|
};
|
|
316
|
-
t.locations && (g.loc = new
|
|
316
|
+
t.locations && (g.loc = new Kt(this, d, v)), t.ranges && (g.range = [o, l]), e.push(g);
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
|
-
var
|
|
319
|
+
var $t = 1, Mt = 2, Ne = 4, ci = 8, Le = 16, pi = 32, he = 64, li = 128, It = 256, Wt = 512, ue = $t | Mt | It;
|
|
320
320
|
function Oe(t, e) {
|
|
321
321
|
return Mt | (t ? Ne : 0) | (e ? ci : 0);
|
|
322
322
|
}
|
|
323
323
|
var ie = 0, Re = 1, Tt = 2, fi = 3, di = 4, mi = 5, H = function(e, s, a) {
|
|
324
|
-
this.options = e =
|
|
324
|
+
this.options = e = xs(e), this.sourceFile = e.sourceFile, this.keywords = kt(cs[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
325
325
|
var o = "";
|
|
326
326
|
e.allowReserved !== !0 && (o = ve[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (o += " await")), this.reservedWords = kt(o);
|
|
327
|
-
var
|
|
328
|
-
this.reservedWordsStrict = kt(
|
|
329
|
-
`, a - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(
|
|
327
|
+
var l = (o ? o + " " : "") + ve.strict;
|
|
328
|
+
this.reservedWordsStrict = kt(l), this.reservedWordsStrictBind = kt(l + " " + ve.strictBind), this.input = String(s), this.containsEsc = !1, a ? (this.pos = a, this.lineStart = this.input.lastIndexOf(`
|
|
329
|
+
`, a - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(J).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = u.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = e.sourceType === "module", this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope($t), this.regexpState = null, this.privateNameStack = [];
|
|
330
330
|
}, mt = { inFunction: { configurable: !0 }, inGenerator: { configurable: !0 }, inAsync: { configurable: !0 }, canAwait: { configurable: !0 }, allowSuper: { configurable: !0 }, allowDirectSuper: { configurable: !0 }, treatFunctionsAsVar: { configurable: !0 }, allowNewDotTarget: { configurable: !0 }, inClassStaticBlock: { configurable: !0 } };
|
|
331
331
|
H.prototype.parse = function() {
|
|
332
332
|
var e = this.options.program || this.startNode();
|
|
@@ -344,7 +344,7 @@ mt.inAsync.get = function() {
|
|
|
344
344
|
mt.canAwait.get = function() {
|
|
345
345
|
for (var t = this.scopeStack.length - 1; t >= 0; t--) {
|
|
346
346
|
var e = this.scopeStack[t], s = e.flags;
|
|
347
|
-
if (s & (It |
|
|
347
|
+
if (s & (It | Wt))
|
|
348
348
|
return !1;
|
|
349
349
|
if (s & Mt)
|
|
350
350
|
return (s & Ne) > 0;
|
|
@@ -364,7 +364,7 @@ mt.treatFunctionsAsVar.get = function() {
|
|
|
364
364
|
mt.allowNewDotTarget.get = function() {
|
|
365
365
|
for (var t = this.scopeStack.length - 1; t >= 0; t--) {
|
|
366
366
|
var e = this.scopeStack[t], s = e.flags;
|
|
367
|
-
if (s & (It |
|
|
367
|
+
if (s & (It | Wt) || s & Mt && !(s & Le))
|
|
368
368
|
return !0;
|
|
369
369
|
}
|
|
370
370
|
return !1;
|
|
@@ -389,66 +389,66 @@ H.tokenizer = function(e, s) {
|
|
|
389
389
|
return new this(s, e);
|
|
390
390
|
};
|
|
391
391
|
Object.defineProperties(H.prototype, mt);
|
|
392
|
-
var
|
|
393
|
-
|
|
392
|
+
var Y = H.prototype, gs = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
393
|
+
Y.strictDirective = function(t) {
|
|
394
394
|
if (this.options.ecmaVersion < 5)
|
|
395
395
|
return !1;
|
|
396
396
|
for (; ; ) {
|
|
397
397
|
W.lastIndex = t, t += W.exec(this.input)[0].length;
|
|
398
|
-
var e =
|
|
398
|
+
var e = gs.exec(this.input.slice(t));
|
|
399
399
|
if (!e)
|
|
400
400
|
return !1;
|
|
401
401
|
if ((e[1] || e[2]) === "use strict") {
|
|
402
402
|
W.lastIndex = t + e[0].length;
|
|
403
403
|
var s = W.exec(this.input), a = s.index + s[0].length, o = this.input.charAt(a);
|
|
404
|
-
return o === ";" || o === "}" ||
|
|
404
|
+
return o === ";" || o === "}" || J.test(s[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(o) || o === "!" && this.input.charAt(a + 1) === "=");
|
|
405
405
|
}
|
|
406
406
|
t += e[0].length, W.lastIndex = t, t += W.exec(this.input)[0].length, this.input[t] === ";" && t++;
|
|
407
407
|
}
|
|
408
408
|
};
|
|
409
|
-
|
|
409
|
+
Y.eat = function(t) {
|
|
410
410
|
return this.type === t ? (this.next(), !0) : !1;
|
|
411
411
|
};
|
|
412
|
-
|
|
412
|
+
Y.isContextual = function(t) {
|
|
413
413
|
return this.type === u.name && this.value === t && !this.containsEsc;
|
|
414
414
|
};
|
|
415
|
-
|
|
415
|
+
Y.eatContextual = function(t) {
|
|
416
416
|
return this.isContextual(t) ? (this.next(), !0) : !1;
|
|
417
417
|
};
|
|
418
|
-
|
|
418
|
+
Y.expectContextual = function(t) {
|
|
419
419
|
this.eatContextual(t) || this.unexpected();
|
|
420
420
|
};
|
|
421
|
-
|
|
422
|
-
return this.type === u.eof || this.type === u.braceR ||
|
|
421
|
+
Y.canInsertSemicolon = function() {
|
|
422
|
+
return this.type === u.eof || this.type === u.braceR || J.test(this.input.slice(this.lastTokEnd, this.start));
|
|
423
423
|
};
|
|
424
|
-
|
|
424
|
+
Y.insertSemicolon = function() {
|
|
425
425
|
if (this.canInsertSemicolon())
|
|
426
426
|
return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
|
|
427
427
|
};
|
|
428
|
-
|
|
428
|
+
Y.semicolon = function() {
|
|
429
429
|
!this.eat(u.semi) && !this.insertSemicolon() && this.unexpected();
|
|
430
430
|
};
|
|
431
|
-
|
|
431
|
+
Y.afterTrailingComma = function(t, e) {
|
|
432
432
|
if (this.type === t)
|
|
433
433
|
return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), e || this.next(), !0;
|
|
434
434
|
};
|
|
435
|
-
|
|
435
|
+
Y.expect = function(t) {
|
|
436
436
|
this.eat(t) || this.unexpected();
|
|
437
437
|
};
|
|
438
|
-
|
|
438
|
+
Y.unexpected = function(t) {
|
|
439
439
|
this.raise(t ?? this.start, "Unexpected token");
|
|
440
440
|
};
|
|
441
441
|
var ce = function() {
|
|
442
442
|
this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
443
443
|
};
|
|
444
|
-
|
|
444
|
+
Y.checkPatternErrors = function(t, e) {
|
|
445
445
|
if (t) {
|
|
446
446
|
t.trailingComma > -1 && this.raiseRecoverable(t.trailingComma, "Comma is not permitted after the rest element");
|
|
447
447
|
var s = e ? t.parenthesizedAssign : t.parenthesizedBind;
|
|
448
448
|
s > -1 && this.raiseRecoverable(s, e ? "Assigning to rvalue" : "Parenthesized pattern");
|
|
449
449
|
}
|
|
450
450
|
};
|
|
451
|
-
|
|
451
|
+
Y.checkExpressionErrors = function(t, e) {
|
|
452
452
|
if (!t)
|
|
453
453
|
return !1;
|
|
454
454
|
var s = t.shorthandAssign, a = t.doubleProto;
|
|
@@ -456,10 +456,10 @@ J.checkExpressionErrors = function(t, e) {
|
|
|
456
456
|
return s >= 0 || a >= 0;
|
|
457
457
|
s >= 0 && this.raise(s, "Shorthand property assignments are valid only in destructuring patterns"), a >= 0 && this.raiseRecoverable(a, "Redefinition of __proto__ property");
|
|
458
458
|
};
|
|
459
|
-
|
|
459
|
+
Y.checkYieldAwaitInDefaultParams = function() {
|
|
460
460
|
this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos) && this.raise(this.yieldPos, "Yield expression cannot be a default value"), this.awaitPos && this.raise(this.awaitPos, "Await expression cannot be a default value");
|
|
461
461
|
};
|
|
462
|
-
|
|
462
|
+
Y.isSimpleAssignTarget = function(t) {
|
|
463
463
|
return t.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(t.expression) : t.type === "Identifier" || t.type === "MemberExpression";
|
|
464
464
|
};
|
|
465
465
|
var w = H.prototype;
|
|
@@ -471,12 +471,12 @@ w.parseTopLevel = function(t) {
|
|
|
471
471
|
}
|
|
472
472
|
if (this.inModule)
|
|
473
473
|
for (var a = 0, o = Object.keys(this.undefinedExports); a < o.length; a += 1) {
|
|
474
|
-
var
|
|
475
|
-
this.raiseRecoverable(this.undefinedExports[
|
|
474
|
+
var l = o[a];
|
|
475
|
+
this.raiseRecoverable(this.undefinedExports[l].start, "Export '" + l + "' is not defined");
|
|
476
476
|
}
|
|
477
477
|
return this.adaptDirectivePrologue(t.body), this.next(), t.sourceType = this.options.sourceType, this.finishNode(t, "Program");
|
|
478
478
|
};
|
|
479
|
-
var Me = { kind: "loop" },
|
|
479
|
+
var Me = { kind: "loop" }, bs = { kind: "switch" };
|
|
480
480
|
w.isLet = function(t) {
|
|
481
481
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let"))
|
|
482
482
|
return !1;
|
|
@@ -493,8 +493,8 @@ w.isLet = function(t) {
|
|
|
493
493
|
++o;
|
|
494
494
|
if (a === 92 || a > 55295 && a < 56320)
|
|
495
495
|
return !0;
|
|
496
|
-
var
|
|
497
|
-
if (!
|
|
496
|
+
var l = this.input.slice(s, o);
|
|
497
|
+
if (!ps.test(l))
|
|
498
498
|
return !0;
|
|
499
499
|
}
|
|
500
500
|
return !1;
|
|
@@ -504,22 +504,22 @@ w.isAsyncFunction = function() {
|
|
|
504
504
|
return !1;
|
|
505
505
|
W.lastIndex = this.pos;
|
|
506
506
|
var t = W.exec(this.input), e = this.pos + t[0].length, s;
|
|
507
|
-
return !
|
|
507
|
+
return !J.test(this.input.slice(this.pos, e)) && this.input.slice(e, e + 8) === "function" && (e + 8 === this.input.length || !(vt(s = this.input.charCodeAt(e + 8)) || s > 55295 && s < 56320));
|
|
508
508
|
};
|
|
509
509
|
w.isUsingKeyword = function(t, e) {
|
|
510
510
|
if (this.options.ecmaVersion < 17 || !this.isContextual(t ? "await" : "using"))
|
|
511
511
|
return !1;
|
|
512
512
|
W.lastIndex = this.pos;
|
|
513
513
|
var s = W.exec(this.input), a = this.pos + s[0].length;
|
|
514
|
-
if (
|
|
514
|
+
if (J.test(this.input.slice(this.pos, a)))
|
|
515
515
|
return !1;
|
|
516
516
|
if (t) {
|
|
517
|
-
var o = a + 5,
|
|
518
|
-
if (this.input.slice(a, o) !== "using" || o === this.input.length || vt(
|
|
517
|
+
var o = a + 5, l;
|
|
518
|
+
if (this.input.slice(a, o) !== "using" || o === this.input.length || vt(l = this.input.charCodeAt(o)) || l > 55295 && l < 56320)
|
|
519
519
|
return !1;
|
|
520
520
|
W.lastIndex = o;
|
|
521
521
|
var d = W.exec(this.input);
|
|
522
|
-
if (d &&
|
|
522
|
+
if (d && J.test(this.input.slice(o, o + d[0].length)))
|
|
523
523
|
return !1;
|
|
524
524
|
}
|
|
525
525
|
if (e) {
|
|
@@ -537,8 +537,8 @@ w.isUsing = function(t) {
|
|
|
537
537
|
return this.isUsingKeyword(!1, t);
|
|
538
538
|
};
|
|
539
539
|
w.parseStatement = function(t, e, s) {
|
|
540
|
-
var a = this.type, o = this.startNode(),
|
|
541
|
-
switch (this.isLet(t) && (a = u._var,
|
|
540
|
+
var a = this.type, o = this.startNode(), l;
|
|
541
|
+
switch (this.isLet(t) && (a = u._var, l = "let"), a) {
|
|
542
542
|
case u._break:
|
|
543
543
|
case u._continue:
|
|
544
544
|
return this.parseBreakContinueStatement(o, a.keyword);
|
|
@@ -564,7 +564,7 @@ w.parseStatement = function(t, e, s) {
|
|
|
564
564
|
return this.parseTryStatement(o);
|
|
565
565
|
case u._const:
|
|
566
566
|
case u._var:
|
|
567
|
-
return
|
|
567
|
+
return l = l || this.value, t && l !== "var" && this.unexpected(), this.parseVarStatement(o, l);
|
|
568
568
|
case u._while:
|
|
569
569
|
return this.parseWhileStatement(o);
|
|
570
570
|
case u._with:
|
|
@@ -623,19 +623,19 @@ w.parseForStatement = function(t) {
|
|
|
623
623
|
var a = this.startNode(), o = s ? "let" : this.value;
|
|
624
624
|
return this.next(), this.parseVar(a, !0, o), this.finishNode(a, "VariableDeclaration"), this.parseForAfterInit(t, a, e);
|
|
625
625
|
}
|
|
626
|
-
var
|
|
626
|
+
var l = this.isContextual("let"), d = !1, v = this.isUsing(!0) ? "using" : this.isAwaitUsing(!0) ? "await using" : null;
|
|
627
627
|
if (v) {
|
|
628
628
|
var g = this.startNode();
|
|
629
629
|
return this.next(), v === "await using" && this.next(), this.parseVar(g, !0, v), this.finishNode(g, "VariableDeclaration"), this.parseForAfterInit(t, g, e);
|
|
630
630
|
}
|
|
631
|
-
var h = this.containsEsc, P = new ce(), N = this.start,
|
|
632
|
-
return this.type === u._in || (d = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (e > -1 ? (this.type === u._in && this.unexpected(e), t.await = !0) : d && this.options.ecmaVersion >= 8 && (
|
|
631
|
+
var h = this.containsEsc, P = new ce(), N = this.start, j = e > -1 ? this.parseExprSubscripts(P, "await") : this.parseExpression(!0, P);
|
|
632
|
+
return this.type === u._in || (d = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (e > -1 ? (this.type === u._in && this.unexpected(e), t.await = !0) : d && this.options.ecmaVersion >= 8 && (j.start === N && !h && j.type === "Identifier" && j.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (t.await = !1)), l && d && this.raise(j.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(j, !1, P), this.checkLValPattern(j), this.parseForIn(t, j)) : (this.checkExpressionErrors(P, !0), e > -1 && this.unexpected(e), this.parseFor(t, j));
|
|
633
633
|
};
|
|
634
634
|
w.parseForAfterInit = function(t, e, s) {
|
|
635
635
|
return (this.type === u._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && e.declarations.length === 1 ? (this.options.ecmaVersion >= 9 && (this.type === u._in ? s > -1 && this.unexpected(s) : t.await = s > -1), this.parseForIn(t, e)) : (s > -1 && this.unexpected(s), this.parseFor(t, e));
|
|
636
636
|
};
|
|
637
637
|
w.parseFunctionStatement = function(t, e, s) {
|
|
638
|
-
return this.next(), this.parseFunction(t,
|
|
638
|
+
return this.next(), this.parseFunction(t, qt | (s ? 0 : Ce), !1, e);
|
|
639
639
|
};
|
|
640
640
|
w.parseIfStatement = function(t) {
|
|
641
641
|
return this.next(), t.test = this.parseParenExpression(), t.consequent = this.parseStatement("if"), t.alternate = this.eat(u._else) ? this.parseStatement("if") : null, this.finishNode(t, "IfStatement");
|
|
@@ -644,7 +644,7 @@ w.parseReturnStatement = function(t) {
|
|
|
644
644
|
return !this.inFunction && !this.options.allowReturnOutsideFunction && this.raise(this.start, "'return' outside of function"), this.next(), this.eat(u.semi) || this.insertSemicolon() ? t.argument = null : (t.argument = this.parseExpression(), this.semicolon()), this.finishNode(t, "ReturnStatement");
|
|
645
645
|
};
|
|
646
646
|
w.parseSwitchStatement = function(t) {
|
|
647
|
-
this.next(), t.discriminant = this.parseParenExpression(), t.cases = [], this.expect(u.braceL), this.labels.push(
|
|
647
|
+
this.next(), t.discriminant = this.parseParenExpression(), t.cases = [], this.expect(u.braceL), this.labels.push(bs), this.enterScope(0);
|
|
648
648
|
for (var e, s = !1; this.type !== u.braceR; )
|
|
649
649
|
if (this.type === u._case || this.type === u._default) {
|
|
650
650
|
var a = this.type === u._case;
|
|
@@ -654,9 +654,9 @@ w.parseSwitchStatement = function(t) {
|
|
|
654
654
|
return this.exitScope(), e && this.finishNode(e, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(t, "SwitchStatement");
|
|
655
655
|
};
|
|
656
656
|
w.parseThrowStatement = function(t) {
|
|
657
|
-
return this.next(),
|
|
657
|
+
return this.next(), J.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), t.argument = this.parseExpression(), this.semicolon(), this.finishNode(t, "ThrowStatement");
|
|
658
658
|
};
|
|
659
|
-
var
|
|
659
|
+
var Ts = [];
|
|
660
660
|
w.parseCatchClauseParam = function() {
|
|
661
661
|
var t = this.parseBindingAtom(), e = t.type === "Identifier";
|
|
662
662
|
return this.enterScope(e ? pi : 0), this.checkLValPattern(t, e ? di : Tt), this.expect(u.parenR), t;
|
|
@@ -681,8 +681,8 @@ w.parseEmptyStatement = function(t) {
|
|
|
681
681
|
return this.next(), this.finishNode(t, "EmptyStatement");
|
|
682
682
|
};
|
|
683
683
|
w.parseLabeledStatement = function(t, e, s, a) {
|
|
684
|
-
for (var o = 0,
|
|
685
|
-
var d =
|
|
684
|
+
for (var o = 0, l = this.labels; o < l.length; o += 1) {
|
|
685
|
+
var d = l[o];
|
|
686
686
|
d.name === e && this.raise(s.start, "Label '" + e + "' is already declared");
|
|
687
687
|
}
|
|
688
688
|
for (var v = this.type.isLoop ? "loop" : this.type === u._switch ? "switch" : null, g = this.labels.length - 1; g >= 0; g--) {
|
|
@@ -725,11 +725,11 @@ w.parseVar = function(t, e, s, a) {
|
|
|
725
725
|
w.parseVarId = function(t, e) {
|
|
726
726
|
t.id = e === "using" || e === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(t.id, e === "var" ? Re : Tt, !1);
|
|
727
727
|
};
|
|
728
|
-
var
|
|
728
|
+
var qt = 1, Ce = 2, yi = 4;
|
|
729
729
|
w.parseFunction = function(t, e, s, a, o) {
|
|
730
|
-
this.initFunction(t), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !a) && (this.type === u.star && e & Ce && this.unexpected(), t.generator = this.eat(u.star)), this.options.ecmaVersion >= 8 && (t.async = !!a), e &
|
|
731
|
-
var
|
|
732
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Oe(t.async, t.generator)), e &
|
|
730
|
+
this.initFunction(t), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !a) && (this.type === u.star && e & Ce && this.unexpected(), t.generator = this.eat(u.star)), this.options.ecmaVersion >= 8 && (t.async = !!a), e & qt && (t.id = e & yi && this.type !== u.name ? null : this.parseIdent(), t.id && !(e & Ce) && this.checkLValSimple(t.id, this.strict || t.generator || t.async ? this.treatFunctionsAsVar ? Re : Tt : fi));
|
|
731
|
+
var l = this.yieldPos, d = this.awaitPos, v = this.awaitIdentPos;
|
|
732
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Oe(t.async, t.generator)), e & qt || (t.id = this.type === u.name ? this.parseIdent() : null), this.parseFunctionParams(t), this.parseFunctionBody(t, s, !1, o), this.yieldPos = l, this.awaitPos = d, this.awaitIdentPos = v, this.finishNode(t, e & qt ? "FunctionDeclaration" : "FunctionExpression");
|
|
733
733
|
};
|
|
734
734
|
w.parseFunctionParams = function(t) {
|
|
735
735
|
this.expect(u.parenL), t.params = this.parseBindingList(u.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
@@ -738,29 +738,29 @@ w.parseClass = function(t, e) {
|
|
|
738
738
|
this.next();
|
|
739
739
|
var s = this.strict;
|
|
740
740
|
this.strict = !0, this.parseClassId(t, e), this.parseClassSuper(t);
|
|
741
|
-
var a = this.enterClassBody(), o = this.startNode(),
|
|
741
|
+
var a = this.enterClassBody(), o = this.startNode(), l = !1;
|
|
742
742
|
for (o.body = [], this.expect(u.braceL); this.type !== u.braceR; ) {
|
|
743
743
|
var d = this.parseClassElement(t.superClass !== null);
|
|
744
|
-
d && (o.body.push(d), d.type === "MethodDefinition" && d.kind === "constructor" ? (
|
|
744
|
+
d && (o.body.push(d), d.type === "MethodDefinition" && d.kind === "constructor" ? (l && this.raiseRecoverable(d.start, "Duplicate constructor in the same class"), l = !0) : d.key && d.key.type === "PrivateIdentifier" && Ss(a, d) && this.raiseRecoverable(d.key.start, "Identifier '#" + d.key.name + "' has already been declared"));
|
|
745
745
|
}
|
|
746
746
|
return this.strict = s, this.next(), t.body = this.finishNode(o, "ClassBody"), this.exitClassBody(), this.finishNode(t, e ? "ClassDeclaration" : "ClassExpression");
|
|
747
747
|
};
|
|
748
748
|
w.parseClassElement = function(t) {
|
|
749
749
|
if (this.eat(u.semi))
|
|
750
750
|
return null;
|
|
751
|
-
var e = this.options.ecmaVersion, s = this.startNode(), a = "", o = !1,
|
|
751
|
+
var e = this.options.ecmaVersion, s = this.startNode(), a = "", o = !1, l = !1, d = "method", v = !1;
|
|
752
752
|
if (this.eatContextual("static")) {
|
|
753
753
|
if (e >= 13 && this.eat(u.braceL))
|
|
754
754
|
return this.parseClassStaticBlock(s), s;
|
|
755
755
|
this.isClassElementNameStart() || this.type === u.star ? v = !0 : a = "static";
|
|
756
756
|
}
|
|
757
|
-
if (s.static = v, !a && e >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === u.star) && !this.canInsertSemicolon() ?
|
|
757
|
+
if (s.static = v, !a && e >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === u.star) && !this.canInsertSemicolon() ? l = !0 : a = "async"), !a && (e >= 9 || !l) && this.eat(u.star) && (o = !0), !a && !l && !o) {
|
|
758
758
|
var g = this.value;
|
|
759
759
|
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? d = g : a = g);
|
|
760
760
|
}
|
|
761
|
-
if (a ? (s.computed = !1, s.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), s.key.name = a, this.finishNode(s.key, "Identifier")) : this.parseClassElementName(s), e < 13 || this.type === u.parenL || d !== "method" || o ||
|
|
761
|
+
if (a ? (s.computed = !1, s.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), s.key.name = a, this.finishNode(s.key, "Identifier")) : this.parseClassElementName(s), e < 13 || this.type === u.parenL || d !== "method" || o || l) {
|
|
762
762
|
var h = !s.static && se(s, "constructor"), P = h && t;
|
|
763
|
-
h && d !== "method" && this.raise(s.key.start, "Constructor can't have get/set modifier"), s.kind = h ? "constructor" : d, this.parseClassMethod(s, o,
|
|
763
|
+
h && d !== "method" && this.raise(s.key.start, "Constructor can't have get/set modifier"), s.kind = h ? "constructor" : d, this.parseClassMethod(s, o, l, P);
|
|
764
764
|
} else
|
|
765
765
|
this.parseClassField(s);
|
|
766
766
|
return s;
|
|
@@ -774,11 +774,11 @@ w.parseClassElementName = function(t) {
|
|
|
774
774
|
w.parseClassMethod = function(t, e, s, a) {
|
|
775
775
|
var o = t.key;
|
|
776
776
|
t.kind === "constructor" ? (e && this.raise(o.start, "Constructor can't be a generator"), s && this.raise(o.start, "Constructor can't be an async method")) : t.static && se(t, "prototype") && this.raise(o.start, "Classes may not have a static property named prototype");
|
|
777
|
-
var
|
|
778
|
-
return t.kind === "get" &&
|
|
777
|
+
var l = t.value = this.parseMethod(e, s, a);
|
|
778
|
+
return t.kind === "get" && l.params.length !== 0 && this.raiseRecoverable(l.start, "getter should have no params"), t.kind === "set" && l.params.length !== 1 && this.raiseRecoverable(l.start, "setter should have exactly one param"), t.kind === "set" && l.params[0].type === "RestElement" && this.raiseRecoverable(l.params[0].start, "Setter cannot use rest params"), this.finishNode(t, "MethodDefinition");
|
|
779
779
|
};
|
|
780
780
|
w.parseClassField = function(t) {
|
|
781
|
-
return se(t, "constructor") ? this.raise(t.key.start, "Classes can't have a field named 'constructor'") : t.static && se(t, "prototype") && this.raise(t.key.start, "Classes can't have a static field named 'prototype'"), this.eat(u.eq) ? (this.enterScope(
|
|
781
|
+
return se(t, "constructor") ? this.raise(t.key.start, "Classes can't have a field named 'constructor'") : t.static && se(t, "prototype") && this.raise(t.key.start, "Classes can't have a static field named 'prototype'"), this.eat(u.eq) ? (this.enterScope(Wt | he), t.value = this.parseMaybeAssign(), this.exitScope()) : t.value = null, this.semicolon(), this.finishNode(t, "PropertyDefinition");
|
|
782
782
|
};
|
|
783
783
|
w.parseClassStaticBlock = function(t) {
|
|
784
784
|
t.body = [];
|
|
@@ -802,12 +802,12 @@ w.enterClassBody = function() {
|
|
|
802
802
|
w.exitClassBody = function() {
|
|
803
803
|
var t = this.privateNameStack.pop(), e = t.declared, s = t.used;
|
|
804
804
|
if (this.options.checkPrivateFields)
|
|
805
|
-
for (var a = this.privateNameStack.length, o = a === 0 ? null : this.privateNameStack[a - 1],
|
|
806
|
-
var d = s[
|
|
805
|
+
for (var a = this.privateNameStack.length, o = a === 0 ? null : this.privateNameStack[a - 1], l = 0; l < s.length; ++l) {
|
|
806
|
+
var d = s[l];
|
|
807
807
|
Rt(e, d.name) || (o ? o.used.push(d) : this.raiseRecoverable(d.start, "Private field '#" + d.name + "' must be declared in an enclosing class"));
|
|
808
808
|
}
|
|
809
809
|
};
|
|
810
|
-
function
|
|
810
|
+
function Ss(t, e) {
|
|
811
811
|
var s = e.key.name, a = t[s], o = "true";
|
|
812
812
|
return e.type === "MethodDefinition" && (e.kind === "get" || e.kind === "set") && (o = (e.static ? "s" : "i") + e.kind), a === "iget" && o === "iset" || a === "iset" && o === "iget" || a === "sget" && o === "sset" || a === "sset" && o === "sget" ? (t[s] = "true", !1) : a ? !0 : (t[s] = o, !1);
|
|
813
813
|
}
|
|
@@ -846,7 +846,7 @@ w.parseExportDefaultDeclaration = function() {
|
|
|
846
846
|
var t;
|
|
847
847
|
if (this.type === u._function || (t = this.isAsyncFunction())) {
|
|
848
848
|
var e = this.startNode();
|
|
849
|
-
return this.next(), t && this.next(), this.parseFunction(e,
|
|
849
|
+
return this.next(), t && this.next(), this.parseFunction(e, qt | yi, !1, t);
|
|
850
850
|
} else if (this.type === u._class) {
|
|
851
851
|
var s = this.startNode();
|
|
852
852
|
return this.parseClass(s, "nullableID");
|
|
@@ -864,8 +864,8 @@ w.checkPatternExport = function(t, e) {
|
|
|
864
864
|
this.checkExport(t, e, e.start);
|
|
865
865
|
else if (s === "ObjectPattern")
|
|
866
866
|
for (var a = 0, o = e.properties; a < o.length; a += 1) {
|
|
867
|
-
var
|
|
868
|
-
this.checkPatternExport(t,
|
|
867
|
+
var l = o[a];
|
|
868
|
+
this.checkPatternExport(t, l);
|
|
869
869
|
}
|
|
870
870
|
else if (s === "ArrayPattern")
|
|
871
871
|
for (var d = 0, v = e.elements; d < v.length; d += 1) {
|
|
@@ -904,7 +904,7 @@ w.parseExportSpecifiers = function(t) {
|
|
|
904
904
|
return e;
|
|
905
905
|
};
|
|
906
906
|
w.parseImport = function(t) {
|
|
907
|
-
return this.next(), this.type === u.string ? (t.specifiers =
|
|
907
|
+
return this.next(), this.type === u.string ? (t.specifiers = Ts, t.source = this.parseExprAtom()) : (t.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), t.source = this.type === u.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (t.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(t, "ImportDeclaration");
|
|
908
908
|
};
|
|
909
909
|
w.parseImportSpecifier = function() {
|
|
910
910
|
var t = this.startNode();
|
|
@@ -955,7 +955,7 @@ w.parseImportAttribute = function() {
|
|
|
955
955
|
w.parseModuleExportName = function() {
|
|
956
956
|
if (this.options.ecmaVersion >= 13 && this.type === u.string) {
|
|
957
957
|
var t = this.parseLiteral(this.value);
|
|
958
|
-
return
|
|
958
|
+
return ys.test(t.value) && this.raise(t.start, "An export name cannot include a lone surrogate."), t;
|
|
959
959
|
}
|
|
960
960
|
return this.parseIdent(!0);
|
|
961
961
|
};
|
|
@@ -982,8 +982,8 @@ pt.toAssignable = function(t, e, s) {
|
|
|
982
982
|
case "ObjectExpression":
|
|
983
983
|
t.type = "ObjectPattern", s && this.checkPatternErrors(s, !0);
|
|
984
984
|
for (var a = 0, o = t.properties; a < o.length; a += 1) {
|
|
985
|
-
var
|
|
986
|
-
this.toAssignable(
|
|
985
|
+
var l = o[a];
|
|
986
|
+
this.toAssignable(l, e), l.type === "RestElement" && (l.argument.type === "ArrayPattern" || l.argument.type === "ObjectPattern") && this.raise(l.argument.start, "Unexpected token");
|
|
987
987
|
}
|
|
988
988
|
break;
|
|
989
989
|
case "Property":
|
|
@@ -1019,8 +1019,8 @@ pt.toAssignableList = function(t, e) {
|
|
|
1019
1019
|
o && this.toAssignable(o, e);
|
|
1020
1020
|
}
|
|
1021
1021
|
if (s) {
|
|
1022
|
-
var
|
|
1023
|
-
this.options.ecmaVersion === 6 && e &&
|
|
1022
|
+
var l = t[s - 1];
|
|
1023
|
+
this.options.ecmaVersion === 6 && e && l && l.type === "RestElement" && l.argument.type !== "Identifier" && this.unexpected(l.argument.start);
|
|
1024
1024
|
}
|
|
1025
1025
|
return t;
|
|
1026
1026
|
};
|
|
@@ -1044,8 +1044,8 @@ pt.parseBindingAtom = function() {
|
|
|
1044
1044
|
return this.parseIdent();
|
|
1045
1045
|
};
|
|
1046
1046
|
pt.parseBindingList = function(t, e, s, a) {
|
|
1047
|
-
for (var o = [],
|
|
1048
|
-
if (
|
|
1047
|
+
for (var o = [], l = !0; !this.eat(t); )
|
|
1048
|
+
if (l ? l = !1 : this.expect(u.comma), e && this.type === u.comma)
|
|
1049
1049
|
o.push(null);
|
|
1050
1050
|
else {
|
|
1051
1051
|
if (s && this.afterTrailingComma(t))
|
|
@@ -1095,8 +1095,8 @@ pt.checkLValPattern = function(t, e, s) {
|
|
|
1095
1095
|
switch (e === void 0 && (e = ie), t.type) {
|
|
1096
1096
|
case "ObjectPattern":
|
|
1097
1097
|
for (var a = 0, o = t.properties; a < o.length; a += 1) {
|
|
1098
|
-
var
|
|
1099
|
-
this.checkLValInnerPattern(
|
|
1098
|
+
var l = o[a];
|
|
1099
|
+
this.checkLValInnerPattern(l, e, s);
|
|
1100
1100
|
}
|
|
1101
1101
|
break;
|
|
1102
1102
|
case "ArrayPattern":
|
|
@@ -1124,8 +1124,8 @@ pt.checkLValInnerPattern = function(t, e, s) {
|
|
|
1124
1124
|
this.checkLValPattern(t, e, s);
|
|
1125
1125
|
}
|
|
1126
1126
|
};
|
|
1127
|
-
var X = function(e, s, a, o,
|
|
1128
|
-
this.token = e, this.isExpr = !!s, this.preserveSpace = !!a, this.override = o, this.generator = !!
|
|
1127
|
+
var X = function(e, s, a, o, l) {
|
|
1128
|
+
this.token = e, this.isExpr = !!s, this.preserveSpace = !!a, this.override = o, this.generator = !!l;
|
|
1129
1129
|
}, F = {
|
|
1130
1130
|
b_stat: new X("{", !1),
|
|
1131
1131
|
b_expr: new X("{", !0),
|
|
@@ -1148,7 +1148,7 @@ Dt.curContext = function() {
|
|
|
1148
1148
|
};
|
|
1149
1149
|
Dt.braceIsBlock = function(t) {
|
|
1150
1150
|
var e = this.curContext();
|
|
1151
|
-
return e === F.f_expr || e === F.f_stat ? !0 : t === u.colon && (e === F.b_stat || e === F.b_expr) ? !e.isExpr : t === u._return || t === u.name && this.exprAllowed ?
|
|
1151
|
+
return e === F.f_expr || e === F.f_stat ? !0 : t === u.colon && (e === F.b_stat || e === F.b_expr) ? !e.isExpr : t === u._return || t === u.name && this.exprAllowed ? J.test(this.input.slice(this.lastTokEnd, this.start)) : t === u._else || t === u.semi || t === u.eof || t === u.parenR || t === u.arrow ? !0 : t === u.braceL ? e === F.b_stat : t === u._var || t === u._const || t === u.name ? !1 : !this.exprAllowed;
|
|
1152
1152
|
};
|
|
1153
1153
|
Dt.inGeneratorContext = function() {
|
|
1154
1154
|
for (var t = this.context.length - 1; t >= 1; t--) {
|
|
@@ -1186,7 +1186,7 @@ u.parenL.updateContext = function(t) {
|
|
|
1186
1186
|
u.incDec.updateContext = function() {
|
|
1187
1187
|
};
|
|
1188
1188
|
u._function.updateContext = u._class.updateContext = function(t) {
|
|
1189
|
-
t.beforeExpr && t !== u._else && !(t === u.semi && this.curContext() !== F.p_stat) && !(t === u._return &&
|
|
1189
|
+
t.beforeExpr && t !== u._else && !(t === u.semi && this.curContext() !== F.p_stat) && !(t === u._return && J.test(this.input.slice(this.lastTokEnd, this.start))) && !((t === u.colon || t === u.braceL) && this.curContext() === F.b_stat) ? this.context.push(F.f_expr) : this.context.push(F.f_stat), this.exprAllowed = !1;
|
|
1190
1190
|
};
|
|
1191
1191
|
u.colon.updateContext = function() {
|
|
1192
1192
|
this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
|
|
@@ -1219,32 +1219,32 @@ _.checkPropClash = function(t, e, s) {
|
|
|
1219
1219
|
default:
|
|
1220
1220
|
return;
|
|
1221
1221
|
}
|
|
1222
|
-
var
|
|
1222
|
+
var l = t.kind;
|
|
1223
1223
|
if (this.options.ecmaVersion >= 6) {
|
|
1224
|
-
o === "__proto__" &&
|
|
1224
|
+
o === "__proto__" && l === "init" && (e.proto && (s ? s.doubleProto < 0 && (s.doubleProto = a.start) : this.raiseRecoverable(a.start, "Redefinition of __proto__ property")), e.proto = !0);
|
|
1225
1225
|
return;
|
|
1226
1226
|
}
|
|
1227
1227
|
o = "$" + o;
|
|
1228
1228
|
var d = e[o];
|
|
1229
1229
|
if (d) {
|
|
1230
1230
|
var v;
|
|
1231
|
-
|
|
1231
|
+
l === "init" ? v = this.strict && d.init || d.get || d.set : v = d.init || d[l], v && this.raiseRecoverable(a.start, "Redefinition of property");
|
|
1232
1232
|
} else
|
|
1233
1233
|
d = e[o] = {
|
|
1234
1234
|
init: !1,
|
|
1235
1235
|
get: !1,
|
|
1236
1236
|
set: !1
|
|
1237
1237
|
};
|
|
1238
|
-
d[
|
|
1238
|
+
d[l] = !0;
|
|
1239
1239
|
}
|
|
1240
1240
|
};
|
|
1241
1241
|
_.parseExpression = function(t, e) {
|
|
1242
1242
|
var s = this.start, a = this.startLoc, o = this.parseMaybeAssign(t, e);
|
|
1243
1243
|
if (this.type === u.comma) {
|
|
1244
|
-
var
|
|
1245
|
-
for (
|
|
1246
|
-
|
|
1247
|
-
return this.finishNode(
|
|
1244
|
+
var l = this.startNodeAt(s, a);
|
|
1245
|
+
for (l.expressions = [o]; this.eat(u.comma); )
|
|
1246
|
+
l.expressions.push(this.parseMaybeAssign(t, e));
|
|
1247
|
+
return this.finishNode(l, "SequenceExpression");
|
|
1248
1248
|
}
|
|
1249
1249
|
return o;
|
|
1250
1250
|
};
|
|
@@ -1254,8 +1254,8 @@ _.parseMaybeAssign = function(t, e, s) {
|
|
|
1254
1254
|
return this.parseYield(t);
|
|
1255
1255
|
this.exprAllowed = !1;
|
|
1256
1256
|
}
|
|
1257
|
-
var a = !1, o = -1,
|
|
1258
|
-
e ? (o = e.parenthesizedAssign,
|
|
1257
|
+
var a = !1, o = -1, l = -1, d = -1;
|
|
1258
|
+
e ? (o = e.parenthesizedAssign, l = e.trailingComma, d = e.doubleProto, e.parenthesizedAssign = e.trailingComma = -1) : (e = new ce(), a = !0);
|
|
1259
1259
|
var v = this.start, g = this.startLoc;
|
|
1260
1260
|
(this.type === u.parenL || this.type === u.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = t === "await");
|
|
1261
1261
|
var h = this.parseMaybeConditional(t, e);
|
|
@@ -1264,15 +1264,15 @@ _.parseMaybeAssign = function(t, e, s) {
|
|
|
1264
1264
|
return P.operator = this.value, this.type === u.eq && (h = this.toAssignable(h, !1, e)), a || (e.parenthesizedAssign = e.trailingComma = e.doubleProto = -1), e.shorthandAssign >= h.start && (e.shorthandAssign = -1), this.type === u.eq ? this.checkLValPattern(h) : this.checkLValSimple(h), P.left = h, this.next(), P.right = this.parseMaybeAssign(t), d > -1 && (e.doubleProto = d), this.finishNode(P, "AssignmentExpression");
|
|
1265
1265
|
} else
|
|
1266
1266
|
a && this.checkExpressionErrors(e, !0);
|
|
1267
|
-
return o > -1 && (e.parenthesizedAssign = o),
|
|
1267
|
+
return o > -1 && (e.parenthesizedAssign = o), l > -1 && (e.trailingComma = l), h;
|
|
1268
1268
|
};
|
|
1269
1269
|
_.parseMaybeConditional = function(t, e) {
|
|
1270
1270
|
var s = this.start, a = this.startLoc, o = this.parseExprOps(t, e);
|
|
1271
1271
|
if (this.checkExpressionErrors(e))
|
|
1272
1272
|
return o;
|
|
1273
1273
|
if (this.eat(u.question)) {
|
|
1274
|
-
var
|
|
1275
|
-
return
|
|
1274
|
+
var l = this.startNodeAt(s, a);
|
|
1275
|
+
return l.test = o, l.consequent = this.parseMaybeAssign(), this.expect(u.colon), l.alternate = this.parseMaybeAssign(t), this.finishNode(l, "ConditionalExpression");
|
|
1276
1276
|
}
|
|
1277
1277
|
return o;
|
|
1278
1278
|
};
|
|
@@ -1281,24 +1281,24 @@ _.parseExprOps = function(t, e) {
|
|
|
1281
1281
|
return this.checkExpressionErrors(e) || o.start === s && o.type === "ArrowFunctionExpression" ? o : this.parseExprOp(o, s, a, -1, t);
|
|
1282
1282
|
};
|
|
1283
1283
|
_.parseExprOp = function(t, e, s, a, o) {
|
|
1284
|
-
var
|
|
1285
|
-
if (
|
|
1284
|
+
var l = this.type.binop;
|
|
1285
|
+
if (l != null && (!o || this.type !== u._in) && l > a) {
|
|
1286
1286
|
var d = this.type === u.logicalOR || this.type === u.logicalAND, v = this.type === u.coalesce;
|
|
1287
|
-
v && (
|
|
1287
|
+
v && (l = u.logicalAND.binop);
|
|
1288
1288
|
var g = this.value;
|
|
1289
1289
|
this.next();
|
|
1290
|
-
var h = this.start, P = this.startLoc, N = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, o), h, P,
|
|
1291
|
-
return (d && this.type === u.coalesce || v && (this.type === u.logicalOR || this.type === u.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(
|
|
1290
|
+
var h = this.start, P = this.startLoc, N = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, o), h, P, l, o), j = this.buildBinary(e, s, t, N, g, d || v);
|
|
1291
|
+
return (d && this.type === u.coalesce || v && (this.type === u.logicalOR || this.type === u.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(j, e, s, a, o);
|
|
1292
1292
|
}
|
|
1293
1293
|
return t;
|
|
1294
1294
|
};
|
|
1295
|
-
_.buildBinary = function(t, e, s, a, o,
|
|
1295
|
+
_.buildBinary = function(t, e, s, a, o, l) {
|
|
1296
1296
|
a.type === "PrivateIdentifier" && this.raise(a.start, "Private identifier can only be left side of binary expression");
|
|
1297
1297
|
var d = this.startNodeAt(t, e);
|
|
1298
|
-
return d.left = s, d.operator = o, d.right = a, this.finishNode(d,
|
|
1298
|
+
return d.left = s, d.operator = o, d.right = a, this.finishNode(d, l ? "LogicalExpression" : "BinaryExpression");
|
|
1299
1299
|
};
|
|
1300
1300
|
_.parseMaybeUnary = function(t, e, s, a) {
|
|
1301
|
-
var o = this.start,
|
|
1301
|
+
var o = this.start, l = this.startLoc, d;
|
|
1302
1302
|
if (this.isContextual("await") && this.canAwait)
|
|
1303
1303
|
d = this.parseAwait(a), e = !0;
|
|
1304
1304
|
else if (this.type.prefix) {
|
|
@@ -1310,7 +1310,7 @@ _.parseMaybeUnary = function(t, e, s, a) {
|
|
|
1310
1310
|
if (d = this.parseExprSubscripts(t, a), this.checkExpressionErrors(t))
|
|
1311
1311
|
return d;
|
|
1312
1312
|
for (; this.type.postfix && !this.canInsertSemicolon(); ) {
|
|
1313
|
-
var h = this.startNodeAt(o,
|
|
1313
|
+
var h = this.startNodeAt(o, l);
|
|
1314
1314
|
h.operator = this.value, h.prefix = !1, h.argument = d, this.checkLValSimple(d), this.next(), d = this.finishNode(h, "UpdateExpression");
|
|
1315
1315
|
}
|
|
1316
1316
|
}
|
|
@@ -1318,7 +1318,7 @@ _.parseMaybeUnary = function(t, e, s, a) {
|
|
|
1318
1318
|
if (e)
|
|
1319
1319
|
this.unexpected(this.lastTokStart);
|
|
1320
1320
|
else
|
|
1321
|
-
return this.buildBinary(o,
|
|
1321
|
+
return this.buildBinary(o, l, d, this.parseMaybeUnary(null, !1, !1, a), "**", !1);
|
|
1322
1322
|
else
|
|
1323
1323
|
return d;
|
|
1324
1324
|
};
|
|
@@ -1332,12 +1332,12 @@ _.parseExprSubscripts = function(t, e) {
|
|
|
1332
1332
|
var s = this.start, a = this.startLoc, o = this.parseExprAtom(t, e);
|
|
1333
1333
|
if (o.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
|
|
1334
1334
|
return o;
|
|
1335
|
-
var
|
|
1336
|
-
return t &&
|
|
1335
|
+
var l = this.parseSubscripts(o, s, a, !1, e);
|
|
1336
|
+
return t && l.type === "MemberExpression" && (t.parenthesizedAssign >= l.start && (t.parenthesizedAssign = -1), t.parenthesizedBind >= l.start && (t.parenthesizedBind = -1), t.trailingComma >= l.start && (t.trailingComma = -1)), l;
|
|
1337
1337
|
};
|
|
1338
1338
|
_.parseSubscripts = function(t, e, s, a, o) {
|
|
1339
|
-
for (var
|
|
1340
|
-
var v = this.parseSubscript(t, e, s, a,
|
|
1339
|
+
for (var l = this.options.ecmaVersion >= 8 && t.type === "Identifier" && t.name === "async" && this.lastTokEnd === t.end && !this.canInsertSemicolon() && t.end - t.start === 5 && this.potentialArrowAt === t.start, d = !1; ; ) {
|
|
1340
|
+
var v = this.parseSubscript(t, e, s, a, l, d, o);
|
|
1341
1341
|
if (v.optional && (d = !0), v === t || v.type === "ArrowFunctionExpression") {
|
|
1342
1342
|
if (d) {
|
|
1343
1343
|
var g = this.startNodeAt(e, s);
|
|
@@ -1354,7 +1354,7 @@ _.shouldParseAsyncArrow = function() {
|
|
|
1354
1354
|
_.parseSubscriptAsyncArrow = function(t, e, s, a) {
|
|
1355
1355
|
return this.parseArrowExpression(this.startNodeAt(t, e), s, !0, a);
|
|
1356
1356
|
};
|
|
1357
|
-
_.parseSubscript = function(t, e, s, a, o,
|
|
1357
|
+
_.parseSubscript = function(t, e, s, a, o, l, d) {
|
|
1358
1358
|
var v = this.options.ecmaVersion >= 11, g = v && this.eat(u.questionDot);
|
|
1359
1359
|
a && g && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
1360
1360
|
var h = this.eat(u.bracketL);
|
|
@@ -1362,18 +1362,18 @@ _.parseSubscript = function(t, e, s, a, o, f, d) {
|
|
|
1362
1362
|
var P = this.startNodeAt(e, s);
|
|
1363
1363
|
P.object = t, h ? (P.property = this.parseExpression(), this.expect(u.bracketR)) : this.type === u.privateId && t.type !== "Super" ? P.property = this.parsePrivateIdent() : P.property = this.parseIdent(this.options.allowReserved !== "never"), P.computed = !!h, v && (P.optional = g), t = this.finishNode(P, "MemberExpression");
|
|
1364
1364
|
} else if (!a && this.eat(u.parenL)) {
|
|
1365
|
-
var N = new ce(),
|
|
1365
|
+
var N = new ce(), j = this.yieldPos, nt = this.awaitPos, lt = this.awaitIdentPos;
|
|
1366
1366
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
1367
1367
|
var _t = this.parseExprList(u.parenR, this.options.ecmaVersion >= 8, !1, N);
|
|
1368
1368
|
if (o && !g && this.shouldParseAsyncArrow())
|
|
1369
|
-
return this.checkPatternErrors(N, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos =
|
|
1370
|
-
this.checkExpressionErrors(N, !0), this.yieldPos =
|
|
1369
|
+
return this.checkPatternErrors(N, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = j, this.awaitPos = nt, this.awaitIdentPos = lt, this.parseSubscriptAsyncArrow(e, s, _t, d);
|
|
1370
|
+
this.checkExpressionErrors(N, !0), this.yieldPos = j || this.yieldPos, this.awaitPos = nt || this.awaitPos, this.awaitIdentPos = lt || this.awaitIdentPos;
|
|
1371
1371
|
var I = this.startNodeAt(e, s);
|
|
1372
1372
|
I.callee = t, I.arguments = _t, v && (I.optional = g), t = this.finishNode(I, "CallExpression");
|
|
1373
1373
|
} else if (this.type === u.backQuote) {
|
|
1374
|
-
(g ||
|
|
1375
|
-
var
|
|
1376
|
-
|
|
1374
|
+
(g || l) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
1375
|
+
var Z = this.startNodeAt(e, s);
|
|
1376
|
+
Z.tag = t, Z.quasi = this.parseTemplate({ isTagged: !0 }), t = this.finishNode(Z, "TaggedTemplateExpression");
|
|
1377
1377
|
}
|
|
1378
1378
|
return t;
|
|
1379
1379
|
};
|
|
@@ -1386,14 +1386,14 @@ _.parseExprAtom = function(t, e, s) {
|
|
|
1386
1386
|
case u._this:
|
|
1387
1387
|
return a = this.startNode(), this.next(), this.finishNode(a, "ThisExpression");
|
|
1388
1388
|
case u.name:
|
|
1389
|
-
var
|
|
1389
|
+
var l = this.start, d = this.startLoc, v = this.containsEsc, g = this.parseIdent(!1);
|
|
1390
1390
|
if (this.options.ecmaVersion >= 8 && !v && g.name === "async" && !this.canInsertSemicolon() && this.eat(u._function))
|
|
1391
|
-
return this.overrideContext(F.f_expr), this.parseFunction(this.startNodeAt(
|
|
1391
|
+
return this.overrideContext(F.f_expr), this.parseFunction(this.startNodeAt(l, d), 0, !1, !0, e);
|
|
1392
1392
|
if (o && !this.canInsertSemicolon()) {
|
|
1393
1393
|
if (this.eat(u.arrow))
|
|
1394
|
-
return this.parseArrowExpression(this.startNodeAt(
|
|
1394
|
+
return this.parseArrowExpression(this.startNodeAt(l, d), [g], !1, e);
|
|
1395
1395
|
if (this.options.ecmaVersion >= 8 && g.name === "async" && this.type === u.name && !v && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc))
|
|
1396
|
-
return g = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(u.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(
|
|
1396
|
+
return g = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(u.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(l, d), [g], !0, e);
|
|
1397
1397
|
}
|
|
1398
1398
|
return g;
|
|
1399
1399
|
case u.regexp:
|
|
@@ -1467,12 +1467,12 @@ _.shouldParseArrow = function(t) {
|
|
|
1467
1467
|
return !this.canInsertSemicolon();
|
|
1468
1468
|
};
|
|
1469
1469
|
_.parseParenAndDistinguishExpression = function(t, e) {
|
|
1470
|
-
var s = this.start, a = this.startLoc, o,
|
|
1470
|
+
var s = this.start, a = this.startLoc, o, l = this.options.ecmaVersion >= 8;
|
|
1471
1471
|
if (this.options.ecmaVersion >= 6) {
|
|
1472
1472
|
this.next();
|
|
1473
|
-
var d = this.start, v = this.startLoc, g = [], h = !0, P = !1, N = new ce(),
|
|
1473
|
+
var d = this.start, v = this.startLoc, g = [], h = !0, P = !1, N = new ce(), j = this.yieldPos, nt = this.awaitPos, lt;
|
|
1474
1474
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== u.parenR; )
|
|
1475
|
-
if (h ? h = !1 : this.expect(u.comma),
|
|
1475
|
+
if (h ? h = !1 : this.expect(u.comma), l && this.afterTrailingComma(u.parenR, !0)) {
|
|
1476
1476
|
P = !0;
|
|
1477
1477
|
break;
|
|
1478
1478
|
} else if (this.type === u.ellipsis) {
|
|
@@ -1485,13 +1485,13 @@ _.parseParenAndDistinguishExpression = function(t, e) {
|
|
|
1485
1485
|
g.push(this.parseMaybeAssign(!1, N, this.parseParenItem));
|
|
1486
1486
|
var _t = this.lastTokEnd, I = this.lastTokEndLoc;
|
|
1487
1487
|
if (this.expect(u.parenR), t && this.shouldParseArrow(g) && this.eat(u.arrow))
|
|
1488
|
-
return this.checkPatternErrors(N, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos =
|
|
1489
|
-
(!g.length || P) && this.unexpected(this.lastTokStart), lt && this.unexpected(lt), this.checkExpressionErrors(N, !0), this.yieldPos =
|
|
1488
|
+
return this.checkPatternErrors(N, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = j, this.awaitPos = nt, this.parseParenArrowList(s, a, g, e);
|
|
1489
|
+
(!g.length || P) && this.unexpected(this.lastTokStart), lt && this.unexpected(lt), this.checkExpressionErrors(N, !0), this.yieldPos = j || this.yieldPos, this.awaitPos = nt || this.awaitPos, g.length > 1 ? (o = this.startNodeAt(d, v), o.expressions = g, this.finishNodeAt(o, "SequenceExpression", _t, I)) : o = g[0];
|
|
1490
1490
|
} else
|
|
1491
1491
|
o = this.parseParenExpression();
|
|
1492
1492
|
if (this.options.preserveParens) {
|
|
1493
|
-
var
|
|
1494
|
-
return
|
|
1493
|
+
var Z = this.startNodeAt(s, a);
|
|
1494
|
+
return Z.expression = o, this.finishNode(Z, "ParenthesizedExpression");
|
|
1495
1495
|
} else
|
|
1496
1496
|
return o;
|
|
1497
1497
|
};
|
|
@@ -1501,7 +1501,7 @@ _.parseParenItem = function(t) {
|
|
|
1501
1501
|
_.parseParenArrowList = function(t, e, s, a) {
|
|
1502
1502
|
return this.parseArrowExpression(this.startNodeAt(t, e), s, !1, a);
|
|
1503
1503
|
};
|
|
1504
|
-
var
|
|
1504
|
+
var Ps = [];
|
|
1505
1505
|
_.parseNew = function() {
|
|
1506
1506
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
1507
1507
|
var t = this.startNode();
|
|
@@ -1512,7 +1512,7 @@ _.parseNew = function() {
|
|
|
1512
1512
|
return t.property = this.parseIdent(!0), t.property.name !== "target" && this.raiseRecoverable(t.property.start, "The only valid meta property for new is 'new.target'"), s && this.raiseRecoverable(t.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(t.start, "'new.target' can only be used in functions and class static block"), this.finishNode(t, "MetaProperty");
|
|
1513
1513
|
}
|
|
1514
1514
|
var a = this.start, o = this.startLoc;
|
|
1515
|
-
return t.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), a, o, !0, !1), this.eat(u.parenL) ? t.arguments = this.parseExprList(u.parenR, this.options.ecmaVersion >= 8, !1) : t.arguments =
|
|
1515
|
+
return t.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), a, o, !0, !1), this.eat(u.parenL) ? t.arguments = this.parseExprList(u.parenR, this.options.ecmaVersion >= 8, !1) : t.arguments = Ps, this.finishNode(t, "NewExpression");
|
|
1516
1516
|
};
|
|
1517
1517
|
_.parseTemplateElement = function(t) {
|
|
1518
1518
|
var e = t.isTagged, s = this.startNode();
|
|
@@ -1538,7 +1538,7 @@ _.parseTemplate = function(t) {
|
|
|
1538
1538
|
return this.next(), this.finishNode(s, "TemplateLiteral");
|
|
1539
1539
|
};
|
|
1540
1540
|
_.isAsyncProp = function(t) {
|
|
1541
|
-
return !t.computed && t.key.type === "Identifier" && t.key.name === "async" && (this.type === u.name || this.type === u.num || this.type === u.string || this.type === u.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === u.star) && !
|
|
1541
|
+
return !t.computed && t.key.type === "Identifier" && t.key.name === "async" && (this.type === u.name || this.type === u.num || this.type === u.string || this.type === u.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === u.star) && !J.test(this.input.slice(this.lastTokEnd, this.start));
|
|
1542
1542
|
};
|
|
1543
1543
|
_.parseObj = function(t, e) {
|
|
1544
1544
|
var s = this.startNode(), a = !0, o = {};
|
|
@@ -1547,18 +1547,18 @@ _.parseObj = function(t, e) {
|
|
|
1547
1547
|
a = !1;
|
|
1548
1548
|
else if (this.expect(u.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(u.braceR))
|
|
1549
1549
|
break;
|
|
1550
|
-
var
|
|
1551
|
-
t || this.checkPropClash(
|
|
1550
|
+
var l = this.parseProperty(t, e);
|
|
1551
|
+
t || this.checkPropClash(l, o, e), s.properties.push(l);
|
|
1552
1552
|
}
|
|
1553
1553
|
return this.finishNode(s, t ? "ObjectPattern" : "ObjectExpression");
|
|
1554
1554
|
};
|
|
1555
1555
|
_.parseProperty = function(t, e) {
|
|
1556
|
-
var s = this.startNode(), a, o,
|
|
1556
|
+
var s = this.startNode(), a, o, l, d;
|
|
1557
1557
|
if (this.options.ecmaVersion >= 9 && this.eat(u.ellipsis))
|
|
1558
1558
|
return t ? (s.argument = this.parseIdent(!1), this.type === u.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(s, "RestElement")) : (s.argument = this.parseMaybeAssign(!1, e), this.type === u.comma && e && e.trailingComma < 0 && (e.trailingComma = this.start), this.finishNode(s, "SpreadElement"));
|
|
1559
|
-
this.options.ecmaVersion >= 6 && (s.method = !1, s.shorthand = !1, (t || e) && (
|
|
1559
|
+
this.options.ecmaVersion >= 6 && (s.method = !1, s.shorthand = !1, (t || e) && (l = this.start, d = this.startLoc), t || (a = this.eat(u.star)));
|
|
1560
1560
|
var v = this.containsEsc;
|
|
1561
|
-
return this.parsePropertyName(s), !t && !v && this.options.ecmaVersion >= 8 && !a && this.isAsyncProp(s) ? (o = !0, a = this.options.ecmaVersion >= 9 && this.eat(u.star), this.parsePropertyName(s)) : o = !1, this.parsePropertyValue(s, t, a, o,
|
|
1561
|
+
return this.parsePropertyName(s), !t && !v && this.options.ecmaVersion >= 8 && !a && this.isAsyncProp(s) ? (o = !0, a = this.options.ecmaVersion >= 9 && this.eat(u.star), this.parsePropertyName(s)) : o = !1, this.parsePropertyValue(s, t, a, o, l, d, e, v), this.finishNode(s, "Property");
|
|
1562
1562
|
};
|
|
1563
1563
|
_.parseGetterSetter = function(t) {
|
|
1564
1564
|
var e = t.key.name;
|
|
@@ -1570,8 +1570,8 @@ _.parseGetterSetter = function(t) {
|
|
|
1570
1570
|
} else
|
|
1571
1571
|
t.kind === "set" && t.value.params[0].type === "RestElement" && this.raiseRecoverable(t.value.params[0].start, "Setter cannot use rest params");
|
|
1572
1572
|
};
|
|
1573
|
-
_.parsePropertyValue = function(t, e, s, a, o,
|
|
1574
|
-
(s || a) && this.type === u.colon && this.unexpected(), this.eat(u.colon) ? (t.value = e ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, d), t.kind = "init") : this.options.ecmaVersion >= 6 && this.type === u.parenL ? (e && this.unexpected(), t.method = !0, t.value = this.parseMethod(s, a), t.kind = "init") : !e && !v && this.options.ecmaVersion >= 5 && !t.computed && t.key.type === "Identifier" && (t.key.name === "get" || t.key.name === "set") && this.type !== u.comma && this.type !== u.braceR && this.type !== u.eq ? ((s || a) && this.unexpected(), this.parseGetterSetter(t)) : this.options.ecmaVersion >= 6 && !t.computed && t.key.type === "Identifier" ? ((s || a) && this.unexpected(), this.checkUnreserved(t.key), t.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = o), e ? t.value = this.parseMaybeDefault(o,
|
|
1573
|
+
_.parsePropertyValue = function(t, e, s, a, o, l, d, v) {
|
|
1574
|
+
(s || a) && this.type === u.colon && this.unexpected(), this.eat(u.colon) ? (t.value = e ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, d), t.kind = "init") : this.options.ecmaVersion >= 6 && this.type === u.parenL ? (e && this.unexpected(), t.method = !0, t.value = this.parseMethod(s, a), t.kind = "init") : !e && !v && this.options.ecmaVersion >= 5 && !t.computed && t.key.type === "Identifier" && (t.key.name === "get" || t.key.name === "set") && this.type !== u.comma && this.type !== u.braceR && this.type !== u.eq ? ((s || a) && this.unexpected(), this.parseGetterSetter(t)) : this.options.ecmaVersion >= 6 && !t.computed && t.key.type === "Identifier" ? ((s || a) && this.unexpected(), this.checkUnreserved(t.key), t.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = o), e ? t.value = this.parseMaybeDefault(o, l, this.copyNode(t.key)) : this.type === u.eq && d ? (d.shorthandAssign < 0 && (d.shorthandAssign = this.start), t.value = this.parseMaybeDefault(o, l, this.copyNode(t.key))) : t.value = this.copyNode(t.key), t.kind = "init", t.shorthand = !0) : this.unexpected();
|
|
1575
1575
|
};
|
|
1576
1576
|
_.parsePropertyName = function(t) {
|
|
1577
1577
|
if (this.options.ecmaVersion >= 6) {
|
|
@@ -1585,22 +1585,22 @@ _.initFunction = function(t) {
|
|
|
1585
1585
|
t.id = null, this.options.ecmaVersion >= 6 && (t.generator = t.expression = !1), this.options.ecmaVersion >= 8 && (t.async = !1);
|
|
1586
1586
|
};
|
|
1587
1587
|
_.parseMethod = function(t, e, s) {
|
|
1588
|
-
var a = this.startNode(), o = this.yieldPos,
|
|
1589
|
-
return this.initFunction(a), this.options.ecmaVersion >= 6 && (a.generator = t), this.options.ecmaVersion >= 8 && (a.async = !!e), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Oe(e, a.generator) | he | (s ? li : 0)), this.expect(u.parenL), a.params = this.parseBindingList(u.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(a, !1, !0, !1), this.yieldPos = o, this.awaitPos =
|
|
1588
|
+
var a = this.startNode(), o = this.yieldPos, l = this.awaitPos, d = this.awaitIdentPos;
|
|
1589
|
+
return this.initFunction(a), this.options.ecmaVersion >= 6 && (a.generator = t), this.options.ecmaVersion >= 8 && (a.async = !!e), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Oe(e, a.generator) | he | (s ? li : 0)), this.expect(u.parenL), a.params = this.parseBindingList(u.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(a, !1, !0, !1), this.yieldPos = o, this.awaitPos = l, this.awaitIdentPos = d, this.finishNode(a, "FunctionExpression");
|
|
1590
1590
|
};
|
|
1591
1591
|
_.parseArrowExpression = function(t, e, s, a) {
|
|
1592
|
-
var o = this.yieldPos,
|
|
1593
|
-
return this.enterScope(Oe(s, !1) | Le), this.initFunction(t), this.options.ecmaVersion >= 8 && (t.async = !!s), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, t.params = this.toAssignableList(e, !0), this.parseFunctionBody(t, !0, !1, a), this.yieldPos = o, this.awaitPos =
|
|
1592
|
+
var o = this.yieldPos, l = this.awaitPos, d = this.awaitIdentPos;
|
|
1593
|
+
return this.enterScope(Oe(s, !1) | Le), this.initFunction(t), this.options.ecmaVersion >= 8 && (t.async = !!s), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, t.params = this.toAssignableList(e, !0), this.parseFunctionBody(t, !0, !1, a), this.yieldPos = o, this.awaitPos = l, this.awaitIdentPos = d, this.finishNode(t, "ArrowFunctionExpression");
|
|
1594
1594
|
};
|
|
1595
1595
|
_.parseFunctionBody = function(t, e, s, a) {
|
|
1596
|
-
var o = e && this.type !== u.braceL,
|
|
1596
|
+
var o = e && this.type !== u.braceL, l = this.strict, d = !1;
|
|
1597
1597
|
if (o)
|
|
1598
1598
|
t.body = this.parseMaybeAssign(a), t.expression = !0, this.checkParams(t, !1);
|
|
1599
1599
|
else {
|
|
1600
1600
|
var v = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(t.params);
|
|
1601
|
-
(!
|
|
1601
|
+
(!l || v) && (d = this.strictDirective(this.end), d && v && this.raiseRecoverable(t.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
|
|
1602
1602
|
var g = this.labels;
|
|
1603
|
-
this.labels = [], d && (this.strict = !0), this.checkParams(t, !
|
|
1603
|
+
this.labels = [], d && (this.strict = !0), this.checkParams(t, !l && !d && !e && !s && this.isSimpleParamList(t.params)), this.strict && t.id && this.checkLValSimple(t.id, mi), t.body = this.parseBlock(!1, void 0, d && !l), t.expression = !1, this.adaptDirectivePrologue(t.body.body), this.labels = g;
|
|
1604
1604
|
}
|
|
1605
1605
|
this.exitScope();
|
|
1606
1606
|
};
|
|
@@ -1614,14 +1614,14 @@ _.isSimpleParamList = function(t) {
|
|
|
1614
1614
|
};
|
|
1615
1615
|
_.checkParams = function(t, e) {
|
|
1616
1616
|
for (var s = /* @__PURE__ */ Object.create(null), a = 0, o = t.params; a < o.length; a += 1) {
|
|
1617
|
-
var
|
|
1618
|
-
this.checkLValInnerPattern(
|
|
1617
|
+
var l = o[a];
|
|
1618
|
+
this.checkLValInnerPattern(l, Re, e ? null : s);
|
|
1619
1619
|
}
|
|
1620
1620
|
};
|
|
1621
1621
|
_.parseExprList = function(t, e, s, a) {
|
|
1622
|
-
for (var o = [],
|
|
1623
|
-
if (
|
|
1624
|
-
|
|
1622
|
+
for (var o = [], l = !0; !this.eat(t); ) {
|
|
1623
|
+
if (l)
|
|
1624
|
+
l = !1;
|
|
1625
1625
|
else if (this.expect(u.comma), e && this.afterTrailingComma(t))
|
|
1626
1626
|
break;
|
|
1627
1627
|
var d = void 0;
|
|
@@ -1670,26 +1670,26 @@ re.curPosition = function() {
|
|
|
1670
1670
|
if (this.options.locations)
|
|
1671
1671
|
return new Ot(this.curLine, this.pos - this.lineStart);
|
|
1672
1672
|
};
|
|
1673
|
-
var wt = H.prototype,
|
|
1673
|
+
var wt = H.prototype, Cs = function(e) {
|
|
1674
1674
|
this.flags = e, this.var = [], this.lexical = [], this.functions = [];
|
|
1675
1675
|
};
|
|
1676
1676
|
wt.enterScope = function(t) {
|
|
1677
|
-
this.scopeStack.push(new
|
|
1677
|
+
this.scopeStack.push(new Cs(t));
|
|
1678
1678
|
};
|
|
1679
1679
|
wt.exitScope = function() {
|
|
1680
1680
|
this.scopeStack.pop();
|
|
1681
1681
|
};
|
|
1682
1682
|
wt.treatFunctionsAsVarInScope = function(t) {
|
|
1683
|
-
return t.flags & Mt || !this.inModule && t.flags &
|
|
1683
|
+
return t.flags & Mt || !this.inModule && t.flags & $t;
|
|
1684
1684
|
};
|
|
1685
1685
|
wt.declareName = function(t, e, s) {
|
|
1686
1686
|
var a = !1;
|
|
1687
1687
|
if (e === Tt) {
|
|
1688
1688
|
var o = this.currentScope();
|
|
1689
|
-
a = o.lexical.indexOf(t) > -1 || o.functions.indexOf(t) > -1 || o.var.indexOf(t) > -1, o.lexical.push(t), this.inModule && o.flags &
|
|
1689
|
+
a = o.lexical.indexOf(t) > -1 || o.functions.indexOf(t) > -1 || o.var.indexOf(t) > -1, o.lexical.push(t), this.inModule && o.flags & $t && delete this.undefinedExports[t];
|
|
1690
1690
|
} else if (e === di) {
|
|
1691
|
-
var
|
|
1692
|
-
|
|
1691
|
+
var l = this.currentScope();
|
|
1692
|
+
l.lexical.push(t);
|
|
1693
1693
|
} else if (e === fi) {
|
|
1694
1694
|
var d = this.currentScope();
|
|
1695
1695
|
this.treatFunctionsAsVar ? a = d.lexical.indexOf(t) > -1 : a = d.lexical.indexOf(t) > -1 || d.var.indexOf(t) > -1, d.functions.push(t);
|
|
@@ -1700,7 +1700,7 @@ wt.declareName = function(t, e, s) {
|
|
|
1700
1700
|
a = !0;
|
|
1701
1701
|
break;
|
|
1702
1702
|
}
|
|
1703
|
-
if (g.var.push(t), this.inModule && g.flags &
|
|
1703
|
+
if (g.var.push(t), this.inModule && g.flags & $t && delete this.undefinedExports[t], g.flags & ue)
|
|
1704
1704
|
break;
|
|
1705
1705
|
}
|
|
1706
1706
|
a && this.raiseRecoverable(s, "Identifier '" + t + "' has already been declared");
|
|
@@ -1714,77 +1714,77 @@ wt.currentScope = function() {
|
|
|
1714
1714
|
wt.currentVarScope = function() {
|
|
1715
1715
|
for (var t = this.scopeStack.length - 1; ; t--) {
|
|
1716
1716
|
var e = this.scopeStack[t];
|
|
1717
|
-
if (e.flags & (ue |
|
|
1717
|
+
if (e.flags & (ue | Wt | It))
|
|
1718
1718
|
return e;
|
|
1719
1719
|
}
|
|
1720
1720
|
};
|
|
1721
1721
|
wt.currentThisScope = function() {
|
|
1722
1722
|
for (var t = this.scopeStack.length - 1; ; t--) {
|
|
1723
1723
|
var e = this.scopeStack[t];
|
|
1724
|
-
if (e.flags & (ue |
|
|
1724
|
+
if (e.flags & (ue | Wt | It) && !(e.flags & Le))
|
|
1725
1725
|
return e;
|
|
1726
1726
|
}
|
|
1727
1727
|
};
|
|
1728
|
-
var
|
|
1729
|
-
this.type = "", this.start = s, this.end = 0, e.options.locations && (this.loc = new
|
|
1730
|
-
},
|
|
1731
|
-
|
|
1732
|
-
return new
|
|
1728
|
+
var zt = function(e, s, a) {
|
|
1729
|
+
this.type = "", this.start = s, this.end = 0, e.options.locations && (this.loc = new Kt(e, a)), e.options.directSourceFile && (this.sourceFile = e.options.directSourceFile), e.options.ranges && (this.range = [s, 0]);
|
|
1730
|
+
}, Xt = H.prototype;
|
|
1731
|
+
Xt.startNode = function() {
|
|
1732
|
+
return new zt(this, this.start, this.startLoc);
|
|
1733
1733
|
};
|
|
1734
|
-
|
|
1735
|
-
return new
|
|
1734
|
+
Xt.startNodeAt = function(t, e) {
|
|
1735
|
+
return new zt(this, t, e);
|
|
1736
1736
|
};
|
|
1737
1737
|
function vi(t, e, s, a) {
|
|
1738
1738
|
return t.type = e, t.end = s, this.options.locations && (t.loc.end = a), this.options.ranges && (t.range[1] = s), t;
|
|
1739
1739
|
}
|
|
1740
|
-
|
|
1740
|
+
Xt.finishNode = function(t, e) {
|
|
1741
1741
|
return vi.call(this, t, e, this.lastTokEnd, this.lastTokEndLoc);
|
|
1742
1742
|
};
|
|
1743
|
-
|
|
1743
|
+
Xt.finishNodeAt = function(t, e, s, a) {
|
|
1744
1744
|
return vi.call(this, t, e, s, a);
|
|
1745
1745
|
};
|
|
1746
|
-
|
|
1747
|
-
var e = new
|
|
1746
|
+
Xt.copyNode = function(t) {
|
|
1747
|
+
var e = new zt(this, t.start, this.startLoc);
|
|
1748
1748
|
for (var s in t)
|
|
1749
1749
|
e[s] = t[s];
|
|
1750
1750
|
return e;
|
|
1751
1751
|
};
|
|
1752
|
-
var
|
|
1752
|
+
var ks = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz", gi = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS", bi = gi + " Extended_Pictographic", Ti = bi, Si = Ti + " EBase EComp EMod EPres ExtPict", Pi = Si, ws = Pi, As = {
|
|
1753
1753
|
9: gi,
|
|
1754
1754
|
10: bi,
|
|
1755
1755
|
11: Ti,
|
|
1756
1756
|
12: Si,
|
|
1757
1757
|
13: Pi,
|
|
1758
|
-
14:
|
|
1759
|
-
},
|
|
1758
|
+
14: ws
|
|
1759
|
+
}, Es = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji", Is = {
|
|
1760
1760
|
9: "",
|
|
1761
1761
|
10: "",
|
|
1762
1762
|
11: "",
|
|
1763
1763
|
12: "",
|
|
1764
1764
|
13: "",
|
|
1765
|
-
14:
|
|
1766
|
-
}, We = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu", Ci = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb", ki = Ci + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", wi = ki + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", Ai = wi + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", Ei = Ai + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",
|
|
1765
|
+
14: Es
|
|
1766
|
+
}, We = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu", Ci = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb", ki = Ci + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", wi = ki + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", Ai = wi + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", Ei = Ai + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith", _s = Ei + " " + ks, Ns = {
|
|
1767
1767
|
9: Ci,
|
|
1768
1768
|
10: ki,
|
|
1769
1769
|
11: wi,
|
|
1770
1770
|
12: Ai,
|
|
1771
1771
|
13: Ei,
|
|
1772
|
-
14:
|
|
1772
|
+
14: _s
|
|
1773
1773
|
}, Ii = {};
|
|
1774
|
-
function
|
|
1774
|
+
function Ls(t) {
|
|
1775
1775
|
var e = Ii[t] = {
|
|
1776
|
-
binary: kt(
|
|
1777
|
-
binaryOfStrings: kt(
|
|
1776
|
+
binary: kt(As[t] + " " + We),
|
|
1777
|
+
binaryOfStrings: kt(Is[t]),
|
|
1778
1778
|
nonBinary: {
|
|
1779
1779
|
General_Category: kt(We),
|
|
1780
|
-
Script: kt(
|
|
1780
|
+
Script: kt(Ns[t])
|
|
1781
1781
|
}
|
|
1782
1782
|
};
|
|
1783
1783
|
e.nonBinary.Script_Extensions = e.nonBinary.Script, e.nonBinary.gc = e.nonBinary.General_Category, e.nonBinary.sc = e.nonBinary.Script, e.nonBinary.scx = e.nonBinary.Script_Extensions;
|
|
1784
1784
|
}
|
|
1785
1785
|
for (var be = 0, ze = [9, 10, 11, 12, 13, 14]; be < ze.length; be += 1) {
|
|
1786
|
-
var
|
|
1787
|
-
|
|
1786
|
+
var Os = ze[be];
|
|
1787
|
+
Ls(Os);
|
|
1788
1788
|
}
|
|
1789
1789
|
var C = H.prototype, ae = function(e, s) {
|
|
1790
1790
|
this.parent = e, this.base = s || this;
|
|
@@ -1803,8 +1803,8 @@ var yt = function(e) {
|
|
|
1803
1803
|
this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = Ii[e.options.ecmaVersion >= 14 ? 14 : e.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = !1, this.switchV = !1, this.switchN = !1, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = !1, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = /* @__PURE__ */ Object.create(null), this.backReferenceNames = [], this.branchID = null;
|
|
1804
1804
|
};
|
|
1805
1805
|
yt.prototype.reset = function(e, s, a) {
|
|
1806
|
-
var o = a.indexOf("v") !== -1,
|
|
1807
|
-
this.start = e | 0, this.source = s + "", this.flags = a, o && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU =
|
|
1806
|
+
var o = a.indexOf("v") !== -1, l = a.indexOf("u") !== -1;
|
|
1807
|
+
this.start = e | 0, this.source = s + "", this.flags = a, o && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = l && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = l && this.parser.options.ecmaVersion >= 9);
|
|
1808
1808
|
};
|
|
1809
1809
|
yt.prototype.raise = function(e) {
|
|
1810
1810
|
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + e);
|
|
@@ -1814,19 +1814,19 @@ yt.prototype.at = function(e, s) {
|
|
|
1814
1814
|
var a = this.source, o = a.length;
|
|
1815
1815
|
if (e >= o)
|
|
1816
1816
|
return -1;
|
|
1817
|
-
var
|
|
1818
|
-
if (!(s || this.switchU) ||
|
|
1819
|
-
return
|
|
1817
|
+
var l = a.charCodeAt(e);
|
|
1818
|
+
if (!(s || this.switchU) || l <= 55295 || l >= 57344 || e + 1 >= o)
|
|
1819
|
+
return l;
|
|
1820
1820
|
var d = a.charCodeAt(e + 1);
|
|
1821
|
-
return d >= 56320 && d <= 57343 ? (
|
|
1821
|
+
return d >= 56320 && d <= 57343 ? (l << 10) + d - 56613888 : l;
|
|
1822
1822
|
};
|
|
1823
1823
|
yt.prototype.nextIndex = function(e, s) {
|
|
1824
1824
|
s === void 0 && (s = !1);
|
|
1825
1825
|
var a = this.source, o = a.length;
|
|
1826
1826
|
if (e >= o)
|
|
1827
1827
|
return o;
|
|
1828
|
-
var
|
|
1829
|
-
return !(s || this.switchU) ||
|
|
1828
|
+
var l = a.charCodeAt(e), d;
|
|
1829
|
+
return !(s || this.switchU) || l <= 55295 || l >= 57344 || e + 1 >= o || (d = a.charCodeAt(e + 1)) < 56320 || d > 57343 ? e + 1 : e + 2;
|
|
1830
1830
|
};
|
|
1831
1831
|
yt.prototype.current = function(e) {
|
|
1832
1832
|
return e === void 0 && (e = !1), this.at(this.pos, e);
|
|
@@ -1842,8 +1842,8 @@ yt.prototype.eat = function(e, s) {
|
|
|
1842
1842
|
};
|
|
1843
1843
|
yt.prototype.eatChars = function(e, s) {
|
|
1844
1844
|
s === void 0 && (s = !1);
|
|
1845
|
-
for (var a = this.pos, o = 0,
|
|
1846
|
-
var d =
|
|
1845
|
+
for (var a = this.pos, o = 0, l = e; o < l.length; o += 1) {
|
|
1846
|
+
var d = l[o], v = this.at(a, s);
|
|
1847
1847
|
if (v === -1 || v !== d)
|
|
1848
1848
|
return !1;
|
|
1849
1849
|
a = this.nextIndex(a, s);
|
|
@@ -1851,19 +1851,19 @@ yt.prototype.eatChars = function(e, s) {
|
|
|
1851
1851
|
return this.pos = a, !0;
|
|
1852
1852
|
};
|
|
1853
1853
|
C.validateRegExpFlags = function(t) {
|
|
1854
|
-
for (var e = t.validFlags, s = t.flags, a = !1, o = !1,
|
|
1855
|
-
var d = s.charAt(
|
|
1856
|
-
e.indexOf(d) === -1 && this.raise(t.start, "Invalid regular expression flag"), s.indexOf(d,
|
|
1854
|
+
for (var e = t.validFlags, s = t.flags, a = !1, o = !1, l = 0; l < s.length; l++) {
|
|
1855
|
+
var d = s.charAt(l);
|
|
1856
|
+
e.indexOf(d) === -1 && this.raise(t.start, "Invalid regular expression flag"), s.indexOf(d, l + 1) > -1 && this.raise(t.start, "Duplicate regular expression flag"), d === "u" && (a = !0), d === "v" && (o = !0);
|
|
1857
1857
|
}
|
|
1858
1858
|
this.options.ecmaVersion >= 15 && a && o && this.raise(t.start, "Invalid regular expression flag");
|
|
1859
1859
|
};
|
|
1860
|
-
function
|
|
1860
|
+
function Rs(t) {
|
|
1861
1861
|
for (var e in t)
|
|
1862
1862
|
return !0;
|
|
1863
1863
|
return !1;
|
|
1864
1864
|
}
|
|
1865
1865
|
C.validateRegExpPattern = function(t) {
|
|
1866
|
-
this.regexp_pattern(t), !t.switchN && this.options.ecmaVersion >= 9 &&
|
|
1866
|
+
this.regexp_pattern(t), !t.switchN && this.options.ecmaVersion >= 9 && Rs(t.groupNames) && (t.switchN = !0, this.regexp_pattern(t));
|
|
1867
1867
|
};
|
|
1868
1868
|
C.regexp_pattern = function(t) {
|
|
1869
1869
|
t.pos = 0, t.lastIntValue = 0, t.lastStringValue = "", t.lastAssertionIsQuantifiable = !1, t.numCapturingParens = 0, t.maxBackReference = 0, t.groupNames = /* @__PURE__ */ Object.create(null), t.backReferenceNames.length = 0, t.branchID = null, this.regexp_disjunction(t), t.pos !== t.source.length && (t.eat(
|
|
@@ -2021,8 +2021,8 @@ C.regexp_eatUncapturingGroup = function(t) {
|
|
|
2021
2021
|
);
|
|
2022
2022
|
if (s || a) {
|
|
2023
2023
|
for (var o = 0; o < s.length; o++) {
|
|
2024
|
-
var
|
|
2025
|
-
s.indexOf(
|
|
2024
|
+
var l = s.charAt(o);
|
|
2025
|
+
s.indexOf(l, o + 1) > -1 && t.raise("Duplicate regular expression modifiers");
|
|
2026
2026
|
}
|
|
2027
2027
|
if (a) {
|
|
2028
2028
|
var d = this.regexp_eatModifiers(t);
|
|
@@ -2065,11 +2065,11 @@ C.regexp_eatCapturingGroup = function(t) {
|
|
|
2065
2065
|
return !1;
|
|
2066
2066
|
};
|
|
2067
2067
|
C.regexp_eatModifiers = function(t) {
|
|
2068
|
-
for (var e = "", s = 0; (s = t.current()) !== -1 &&
|
|
2068
|
+
for (var e = "", s = 0; (s = t.current()) !== -1 && Ms(s); )
|
|
2069
2069
|
e += gt(s), t.advance();
|
|
2070
2070
|
return e;
|
|
2071
2071
|
};
|
|
2072
|
-
function
|
|
2072
|
+
function Ms(t) {
|
|
2073
2073
|
return t === 105 || t === 109 || t === 115;
|
|
2074
2074
|
}
|
|
2075
2075
|
C.regexp_eatExtendedAtom = function(t) {
|
|
@@ -2107,8 +2107,8 @@ C.regexp_groupSpecifier = function(t) {
|
|
|
2107
2107
|
if (s)
|
|
2108
2108
|
if (e)
|
|
2109
2109
|
for (var a = 0, o = s; a < o.length; a += 1) {
|
|
2110
|
-
var
|
|
2111
|
-
|
|
2110
|
+
var l = o[a];
|
|
2111
|
+
l.separatedFrom(t.branchID) || t.raise("Duplicate capture group name");
|
|
2112
2112
|
}
|
|
2113
2113
|
else
|
|
2114
2114
|
t.raise("Duplicate capture group name");
|
|
@@ -2139,16 +2139,16 @@ C.regexp_eatRegExpIdentifierName = function(t) {
|
|
|
2139
2139
|
};
|
|
2140
2140
|
C.regexp_eatRegExpIdentifierStart = function(t) {
|
|
2141
2141
|
var e = t.pos, s = this.options.ecmaVersion >= 11, a = t.current(s);
|
|
2142
|
-
return t.advance(s), a === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(t, s) && (a = t.lastIntValue),
|
|
2142
|
+
return t.advance(s), a === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(t, s) && (a = t.lastIntValue), Ds(a) ? (t.lastIntValue = a, !0) : (t.pos = e, !1);
|
|
2143
2143
|
};
|
|
2144
|
-
function
|
|
2144
|
+
function Ds(t) {
|
|
2145
2145
|
return ft(t, !0) || t === 36 || t === 95;
|
|
2146
2146
|
}
|
|
2147
2147
|
C.regexp_eatRegExpIdentifierPart = function(t) {
|
|
2148
2148
|
var e = t.pos, s = this.options.ecmaVersion >= 11, a = t.current(s);
|
|
2149
|
-
return t.advance(s), a === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(t, s) && (a = t.lastIntValue),
|
|
2149
|
+
return t.advance(s), a === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(t, s) && (a = t.lastIntValue), Vs(a) ? (t.lastIntValue = a, !0) : (t.pos = e, !1);
|
|
2150
2150
|
};
|
|
2151
|
-
function
|
|
2151
|
+
function Vs(t) {
|
|
2152
2152
|
return vt(t, !0) || t === 36 || t === 95 || t === 8204 || t === 8205;
|
|
2153
2153
|
}
|
|
2154
2154
|
C.regexp_eatAtomEscape = function(t) {
|
|
@@ -2216,7 +2216,7 @@ C.regexp_eatRegExpUnicodeEscapeSequence = function(t, e) {
|
|
|
2216
2216
|
if (this.regexp_eatFixedHexDigits(t, 4)) {
|
|
2217
2217
|
var o = t.lastIntValue;
|
|
2218
2218
|
if (a && o >= 55296 && o <= 56319) {
|
|
2219
|
-
var
|
|
2219
|
+
var l = t.pos;
|
|
2220
2220
|
if (t.eat(
|
|
2221
2221
|
92
|
|
2222
2222
|
/* \ */
|
|
@@ -2228,7 +2228,7 @@ C.regexp_eatRegExpUnicodeEscapeSequence = function(t, e) {
|
|
|
2228
2228
|
if (d >= 56320 && d <= 57343)
|
|
2229
2229
|
return t.lastIntValue = (o - 55296) * 1024 + (d - 56320) + 65536, !0;
|
|
2230
2230
|
}
|
|
2231
|
-
t.pos =
|
|
2231
|
+
t.pos = l, t.lastIntValue = o;
|
|
2232
2232
|
}
|
|
2233
2233
|
return !0;
|
|
2234
2234
|
}
|
|
@@ -2238,13 +2238,13 @@ C.regexp_eatRegExpUnicodeEscapeSequence = function(t, e) {
|
|
|
2238
2238
|
) && this.regexp_eatHexDigits(t) && t.eat(
|
|
2239
2239
|
125
|
|
2240
2240
|
/* } */
|
|
2241
|
-
) &&
|
|
2241
|
+
) && Fs(t.lastIntValue))
|
|
2242
2242
|
return !0;
|
|
2243
2243
|
a && t.raise("Invalid unicode escape"), t.pos = s;
|
|
2244
2244
|
}
|
|
2245
2245
|
return !1;
|
|
2246
2246
|
};
|
|
2247
|
-
function
|
|
2247
|
+
function Fs(t) {
|
|
2248
2248
|
return t >= 0 && t <= 1114111;
|
|
2249
2249
|
}
|
|
2250
2250
|
C.regexp_eatIdentityEscape = function(t) {
|
|
@@ -2270,7 +2270,7 @@ C.regexp_eatDecimalEscape = function(t) {
|
|
|
2270
2270
|
var Li = 0, bt = 1, ut = 2;
|
|
2271
2271
|
C.regexp_eatCharacterClassEscape = function(t) {
|
|
2272
2272
|
var e = t.current();
|
|
2273
|
-
if (
|
|
2273
|
+
if (js(e))
|
|
2274
2274
|
return t.lastIntValue = -1, t.advance(), bt;
|
|
2275
2275
|
var s = !1;
|
|
2276
2276
|
if (t.switchU && this.options.ecmaVersion >= 9 && ((s = e === 80) || e === 112)) {
|
|
@@ -2288,7 +2288,7 @@ C.regexp_eatCharacterClassEscape = function(t) {
|
|
|
2288
2288
|
}
|
|
2289
2289
|
return Li;
|
|
2290
2290
|
};
|
|
2291
|
-
function
|
|
2291
|
+
function js(t) {
|
|
2292
2292
|
return t === 100 || t === 68 || t === 115 || t === 83 || t === 119 || t === 87;
|
|
2293
2293
|
}
|
|
2294
2294
|
C.regexp_eatUnicodePropertyValueExpression = function(t) {
|
|
@@ -2534,19 +2534,19 @@ C.regexp_eatClassSetCharacter = function(t) {
|
|
|
2534
2534
|
/* b */
|
|
2535
2535
|
) ? (t.lastIntValue = 8, !0) : (t.pos = e, !1);
|
|
2536
2536
|
var s = t.current();
|
|
2537
|
-
return s < 0 || s === t.lookahead() &&
|
|
2537
|
+
return s < 0 || s === t.lookahead() && Us(s) || qs(s) ? !1 : (t.advance(), t.lastIntValue = s, !0);
|
|
2538
2538
|
};
|
|
2539
|
-
function
|
|
2539
|
+
function Us(t) {
|
|
2540
2540
|
return t === 33 || t >= 35 && t <= 38 || t >= 42 && t <= 44 || t === 46 || t >= 58 && t <= 64 || t === 94 || t === 96 || t === 126;
|
|
2541
2541
|
}
|
|
2542
|
-
function
|
|
2542
|
+
function qs(t) {
|
|
2543
2543
|
return t === 40 || t === 41 || t === 45 || t === 47 || t >= 91 && t <= 93 || t >= 123 && t <= 125;
|
|
2544
2544
|
}
|
|
2545
2545
|
C.regexp_eatClassSetReservedPunctuator = function(t) {
|
|
2546
2546
|
var e = t.current();
|
|
2547
|
-
return
|
|
2547
|
+
return Hs(e) ? (t.lastIntValue = e, t.advance(), !0) : !1;
|
|
2548
2548
|
};
|
|
2549
|
-
function
|
|
2549
|
+
function Hs(t) {
|
|
2550
2550
|
return t === 33 || t === 35 || t === 37 || t === 38 || t === 44 || t === 45 || t >= 58 && t <= 62 || t === 64 || t === 96 || t === 126;
|
|
2551
2551
|
}
|
|
2552
2552
|
C.regexp_eatClassControlLetter = function(t) {
|
|
@@ -2617,7 +2617,7 @@ C.regexp_eatFixedHexDigits = function(t, e) {
|
|
|
2617
2617
|
return !0;
|
|
2618
2618
|
};
|
|
2619
2619
|
var le = function(e) {
|
|
2620
|
-
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new
|
|
2620
|
+
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new Kt(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
|
|
2621
2621
|
}, R = H.prototype;
|
|
2622
2622
|
R.next = function(t) {
|
|
2623
2623
|
!t && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new le(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
@@ -2754,7 +2754,7 @@ R.readToken_caret = function() {
|
|
|
2754
2754
|
};
|
|
2755
2755
|
R.readToken_plus_min = function(t) {
|
|
2756
2756
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
2757
|
-
return e === t ? e === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 ||
|
|
2757
|
+
return e === t ? e === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || J.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(u.incDec, 2) : e === 61 ? this.finishOp(u.assign, 2) : this.finishOp(u.plusMin, 1);
|
|
2758
2758
|
};
|
|
2759
2759
|
R.readToken_lt_gt = function(t) {
|
|
2760
2760
|
var e = this.input.charCodeAt(this.pos + 1), s = 1;
|
|
@@ -2885,7 +2885,7 @@ R.readRegexp = function() {
|
|
|
2885
2885
|
for (var t, e, s = this.pos; ; ) {
|
|
2886
2886
|
this.pos >= this.input.length && this.raise(s, "Unterminated regular expression");
|
|
2887
2887
|
var a = this.input.charAt(this.pos);
|
|
2888
|
-
if (
|
|
2888
|
+
if (J.test(a) && this.raise(s, "Unterminated regular expression"), t)
|
|
2889
2889
|
t = !1;
|
|
2890
2890
|
else {
|
|
2891
2891
|
if (a === "[")
|
|
@@ -2900,8 +2900,8 @@ R.readRegexp = function() {
|
|
|
2900
2900
|
}
|
|
2901
2901
|
var o = this.input.slice(s, this.pos);
|
|
2902
2902
|
++this.pos;
|
|
2903
|
-
var
|
|
2904
|
-
this.containsEsc && this.unexpected(
|
|
2903
|
+
var l = this.pos, d = this.readWord1();
|
|
2904
|
+
this.containsEsc && this.unexpected(l);
|
|
2905
2905
|
var v = this.regexpState || (this.regexpState = new yt(this));
|
|
2906
2906
|
v.reset(s, o, d), this.validateRegExpFlags(v), this.validateRegExpPattern(v);
|
|
2907
2907
|
var g = null;
|
|
@@ -2912,7 +2912,7 @@ R.readRegexp = function() {
|
|
|
2912
2912
|
return this.finishToken(u.regexp, { pattern: o, flags: d, value: g });
|
|
2913
2913
|
};
|
|
2914
2914
|
R.readInt = function(t, e, s) {
|
|
2915
|
-
for (var a = this.options.ecmaVersion >= 12 && e === void 0, o = s && this.input.charCodeAt(this.pos) === 48,
|
|
2915
|
+
for (var a = this.options.ecmaVersion >= 12 && e === void 0, o = s && this.input.charCodeAt(this.pos) === 48, l = this.pos, d = 0, v = 0, g = 0, h = e ?? 1 / 0; g < h; ++g, ++this.pos) {
|
|
2916
2916
|
var P = this.input.charCodeAt(this.pos), N = void 0;
|
|
2917
2917
|
if (a && P === 95) {
|
|
2918
2918
|
o && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), v === 95 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), g === 0 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"), v = P;
|
|
@@ -2922,9 +2922,9 @@ R.readInt = function(t, e, s) {
|
|
|
2922
2922
|
break;
|
|
2923
2923
|
v = P, d = d * t + N;
|
|
2924
2924
|
}
|
|
2925
|
-
return a && v === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos ===
|
|
2925
|
+
return a && v === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === l || e != null && this.pos - l !== e ? null : d;
|
|
2926
2926
|
};
|
|
2927
|
-
function
|
|
2927
|
+
function $s(t, e) {
|
|
2928
2928
|
return e ? parseInt(t, 8) : parseFloat(t.replace(/_/g, ""));
|
|
2929
2929
|
}
|
|
2930
2930
|
function Vi(t) {
|
|
@@ -2947,8 +2947,8 @@ R.readNumber = function(t) {
|
|
|
2947
2947
|
return ++this.pos, ft(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(u.num, o);
|
|
2948
2948
|
}
|
|
2949
2949
|
s && /[89]/.test(this.input.slice(e, this.pos)) && (s = !1), a === 46 && !s && (++this.pos, this.readInt(10), a = this.input.charCodeAt(this.pos)), (a === 69 || a === 101) && !s && (a = this.input.charCodeAt(++this.pos), (a === 43 || a === 45) && ++this.pos, this.readInt(10) === null && this.raise(e, "Invalid number")), ft(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
2950
|
-
var
|
|
2951
|
-
return this.finishToken(u.num,
|
|
2950
|
+
var l = $s(this.input.slice(e, this.pos), s);
|
|
2951
|
+
return this.finishToken(u.num, l);
|
|
2952
2952
|
};
|
|
2953
2953
|
R.readCodePoint = function() {
|
|
2954
2954
|
var t = this.input.charCodeAt(this.pos), e;
|
|
@@ -3106,10 +3106,10 @@ R.readWord1 = function() {
|
|
|
3106
3106
|
this.pos += o <= 65535 ? 1 : 2;
|
|
3107
3107
|
else if (o === 92) {
|
|
3108
3108
|
this.containsEsc = !0, t += this.input.slice(s, this.pos);
|
|
3109
|
-
var
|
|
3109
|
+
var l = this.pos;
|
|
3110
3110
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
3111
3111
|
var d = this.readCodePoint();
|
|
3112
|
-
(e ? ft : vt)(d, a) || this.invalidStringToken(
|
|
3112
|
+
(e ? ft : vt)(d, a) || this.invalidStringToken(l, "Invalid Unicode escape"), t += gt(d), s = this.pos;
|
|
3113
3113
|
} else
|
|
3114
3114
|
break;
|
|
3115
3115
|
e = !1;
|
|
@@ -3120,15 +3120,15 @@ R.readWord = function() {
|
|
|
3120
3120
|
var t = this.readWord1(), e = u.name;
|
|
3121
3121
|
return this.keywords.test(t) && (e = Lt[t]), this.finishToken(e, t);
|
|
3122
3122
|
};
|
|
3123
|
-
var
|
|
3123
|
+
var ji = "8.15.0";
|
|
3124
3124
|
H.acorn = {
|
|
3125
3125
|
Parser: H,
|
|
3126
|
-
version:
|
|
3126
|
+
version: ji,
|
|
3127
3127
|
defaultOptions: ee,
|
|
3128
3128
|
Position: Ot,
|
|
3129
|
-
SourceLocation:
|
|
3129
|
+
SourceLocation: Kt,
|
|
3130
3130
|
getLineInfo: _e,
|
|
3131
|
-
Node:
|
|
3131
|
+
Node: zt,
|
|
3132
3132
|
TokenType: O,
|
|
3133
3133
|
tokTypes: u,
|
|
3134
3134
|
keywordTypes: Lt,
|
|
@@ -3138,25 +3138,25 @@ H.acorn = {
|
|
|
3138
3138
|
isIdentifierStart: ft,
|
|
3139
3139
|
Token: le,
|
|
3140
3140
|
isNewLine: Et,
|
|
3141
|
-
lineBreak:
|
|
3141
|
+
lineBreak: J,
|
|
3142
3142
|
lineBreakG: oi,
|
|
3143
3143
|
nonASCIIwhitespace: Ie
|
|
3144
3144
|
};
|
|
3145
|
-
function
|
|
3145
|
+
function Gs(t, e) {
|
|
3146
3146
|
return H.parse(t, e);
|
|
3147
3147
|
}
|
|
3148
|
-
function
|
|
3148
|
+
function Ks(t, e, s) {
|
|
3149
3149
|
return H.parseExpressionAt(t, e, s);
|
|
3150
3150
|
}
|
|
3151
|
-
function
|
|
3151
|
+
function Ws(t, e) {
|
|
3152
3152
|
return H.tokenizer(t, e);
|
|
3153
3153
|
}
|
|
3154
|
-
const
|
|
3154
|
+
const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3155
3155
|
__proto__: null,
|
|
3156
|
-
Node:
|
|
3156
|
+
Node: zt,
|
|
3157
3157
|
Parser: H,
|
|
3158
3158
|
Position: Ot,
|
|
3159
|
-
SourceLocation:
|
|
3159
|
+
SourceLocation: Kt,
|
|
3160
3160
|
TokContext: X,
|
|
3161
3161
|
Token: le,
|
|
3162
3162
|
TokenType: O,
|
|
@@ -3166,28 +3166,28 @@ const Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3166
3166
|
isIdentifierStart: ft,
|
|
3167
3167
|
isNewLine: Et,
|
|
3168
3168
|
keywordTypes: Lt,
|
|
3169
|
-
lineBreak:
|
|
3169
|
+
lineBreak: J,
|
|
3170
3170
|
lineBreakG: oi,
|
|
3171
3171
|
nonASCIIwhitespace: Ie,
|
|
3172
|
-
parse:
|
|
3173
|
-
parseExpressionAt:
|
|
3172
|
+
parse: Gs,
|
|
3173
|
+
parseExpressionAt: Ks,
|
|
3174
3174
|
tokContexts: F,
|
|
3175
3175
|
tokTypes: u,
|
|
3176
|
-
tokenizer:
|
|
3177
|
-
version:
|
|
3176
|
+
tokenizer: Ws,
|
|
3177
|
+
version: ji
|
|
3178
3178
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3179
3179
|
function Xe(t, e) {
|
|
3180
3180
|
for (var s = 0; s < e.length; s++) {
|
|
3181
3181
|
var a = e[s];
|
|
3182
|
-
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(t, typeof (o = (function(
|
|
3183
|
-
if (typeof
|
|
3184
|
-
var v =
|
|
3182
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(t, typeof (o = (function(l, d) {
|
|
3183
|
+
if (typeof l != "object" || l === null) return l;
|
|
3184
|
+
var v = l[Symbol.toPrimitive];
|
|
3185
3185
|
if (v !== void 0) {
|
|
3186
|
-
var g = v.call(
|
|
3186
|
+
var g = v.call(l, "string");
|
|
3187
3187
|
if (typeof g != "object") return g;
|
|
3188
3188
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3189
3189
|
}
|
|
3190
|
-
return String(
|
|
3190
|
+
return String(l);
|
|
3191
3191
|
})(a.key)) == "symbol" ? o : String(o), a);
|
|
3192
3192
|
}
|
|
3193
3193
|
var o;
|
|
@@ -3201,7 +3201,7 @@ function ne() {
|
|
|
3201
3201
|
return t;
|
|
3202
3202
|
}, ne.apply(this, arguments);
|
|
3203
3203
|
}
|
|
3204
|
-
function
|
|
3204
|
+
function Zt(t, e) {
|
|
3205
3205
|
t.prototype = Object.create(e.prototype), t.prototype.constructor = t, we(t, e);
|
|
3206
3206
|
}
|
|
3207
3207
|
function we(t, e) {
|
|
@@ -3217,11 +3217,11 @@ function Qe(t, e) {
|
|
|
3217
3217
|
function Je(t, e) {
|
|
3218
3218
|
var s = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
3219
3219
|
if (s) return (s = s.call(t)).next.bind(s);
|
|
3220
|
-
if (Array.isArray(t) || (s = (function(o,
|
|
3220
|
+
if (Array.isArray(t) || (s = (function(o, l) {
|
|
3221
3221
|
if (o) {
|
|
3222
|
-
if (typeof o == "string") return Qe(o,
|
|
3222
|
+
if (typeof o == "string") return Qe(o, l);
|
|
3223
3223
|
var d = Object.prototype.toString.call(o).slice(8, -1);
|
|
3224
|
-
return d === "Object" && o.constructor && (d = o.constructor.name), d === "Map" || d === "Set" ? Array.from(o) : d === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d) ? Qe(o,
|
|
3224
|
+
return d === "Object" && o.constructor && (d = o.constructor.name), d === "Map" || d === "Set" ? Array.from(o) : d === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d) ? Qe(o, l) : void 0;
|
|
3225
3225
|
}
|
|
3226
3226
|
})(t)) || e) {
|
|
3227
3227
|
s && (t = s);
|
|
@@ -3237,17 +3237,17 @@ var st = !0;
|
|
|
3237
3237
|
function rt(t, e) {
|
|
3238
3238
|
return e === void 0 && (e = {}), new O("name", e);
|
|
3239
3239
|
}
|
|
3240
|
-
var
|
|
3241
|
-
function
|
|
3242
|
-
var e =
|
|
3240
|
+
var Xs = /* @__PURE__ */ new WeakMap();
|
|
3241
|
+
function Qs(t) {
|
|
3242
|
+
var e = Xs.get(t.Parser.acorn || t);
|
|
3243
3243
|
if (!e) {
|
|
3244
|
-
var s = { assert: rt(0, { startsExpr: st }), asserts: rt(0, { startsExpr: st }), global: rt(0, { startsExpr: st }), keyof: rt(0, { startsExpr: st }), readonly: rt(0, { startsExpr: st }), unique: rt(0, { startsExpr: st }), abstract: rt(0, { startsExpr: st }), declare: rt(0, { startsExpr: st }), enum: rt(0, { startsExpr: st }), module: rt(0, { startsExpr: st }), namespace: rt(0, { startsExpr: st }), interface: rt(0, { startsExpr: st }), type: rt(0, { startsExpr: st }) }, a = { at: new O("@"), jsxName: new O("jsxName"), jsxText: new O("jsxText", { beforeExpr: !0 }), jsxTagStart: new O("jsxTagStart", { startsExpr: !0 }), jsxTagEnd: new O("jsxTagEnd") }, o = { tc_oTag: new X("<tag", !1, !1), tc_cTag: new X("</tag", !1, !1), tc_expr: new X("<tag>...</tag>", !0, !0) },
|
|
3244
|
+
var s = { assert: rt(0, { startsExpr: st }), asserts: rt(0, { startsExpr: st }), global: rt(0, { startsExpr: st }), keyof: rt(0, { startsExpr: st }), readonly: rt(0, { startsExpr: st }), unique: rt(0, { startsExpr: st }), abstract: rt(0, { startsExpr: st }), declare: rt(0, { startsExpr: st }), enum: rt(0, { startsExpr: st }), module: rt(0, { startsExpr: st }), namespace: rt(0, { startsExpr: st }), interface: rt(0, { startsExpr: st }), type: rt(0, { startsExpr: st }) }, a = { at: new O("@"), jsxName: new O("jsxName"), jsxText: new O("jsxText", { beforeExpr: !0 }), jsxTagStart: new O("jsxTagStart", { startsExpr: !0 }), jsxTagEnd: new O("jsxTagEnd") }, o = { tc_oTag: new X("<tag", !1, !1), tc_cTag: new X("</tag", !1, !1), tc_expr: new X("<tag>...</tag>", !0, !0) }, l = new RegExp("^(?:" + Object.keys(s).join("|") + ")$");
|
|
3245
3245
|
a.jsxTagStart.updateContext = function() {
|
|
3246
3246
|
this.context.push(o.tc_expr), this.context.push(o.tc_oTag), this.exprAllowed = !1;
|
|
3247
3247
|
}, a.jsxTagEnd.updateContext = function(d) {
|
|
3248
3248
|
var v = this.context.pop();
|
|
3249
3249
|
v === o.tc_oTag && d === u.slash || v === o.tc_cTag ? (this.context.pop(), this.exprAllowed = this.curContext() === o.tc_expr) : this.exprAllowed = !0;
|
|
3250
|
-
}, e = { tokTypes: ne({}, s, a), tokContexts: ne({}, o), keywordsRegExp:
|
|
3250
|
+
}, e = { tokTypes: ne({}, s, a), tokContexts: ne({}, o), keywordsRegExp: l, tokenIsLiteralPropertyName: function(d) {
|
|
3251
3251
|
return [u.name, u.string, u.num].concat(Object.values(Lt), Object.values(s)).includes(d);
|
|
3252
3252
|
}, tokenIsKeywordOrIdentifier: function(d) {
|
|
3253
3253
|
return [u.name].concat(Object.values(Lt), Object.values(s)).includes(d);
|
|
@@ -3263,10 +3263,10 @@ function Xs(t) {
|
|
|
3263
3263
|
}
|
|
3264
3264
|
return e;
|
|
3265
3265
|
}
|
|
3266
|
-
var
|
|
3266
|
+
var jt = 1024, Js = new RegExp("(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*", "y"), Ye = new RegExp("(?=(" + Js.source + "))\\1" + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y"), Bt = function() {
|
|
3267
3267
|
this.shorthandAssign = void 0, this.trailingComma = void 0, this.parenthesizedAssign = void 0, this.parenthesizedBind = void 0, this.doubleProto = void 0, this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
3268
3268
|
};
|
|
3269
|
-
function
|
|
3269
|
+
function Ys(t, e) {
|
|
3270
3270
|
var s = e.key.name, a = t[s], o = "true";
|
|
3271
3271
|
return e.type !== "MethodDefinition" || e.kind !== "get" && e.kind !== "set" || (o = (e.static ? "s" : "i") + e.kind), a === "iget" && o === "iset" || a === "iset" && o === "iget" || a === "sget" && o === "sset" || a === "sset" && o === "sget" ? (t[s] = "true", !1) : !!a || (t[s] = o, !1);
|
|
3272
3272
|
}
|
|
@@ -3311,67 +3311,67 @@ var A = { AbstractMethodHasImplementation: function(t) {
|
|
|
3311
3311
|
return "Single type parameter " + e + " should have a trailing comma. Example usage: <" + e + ",>.";
|
|
3312
3312
|
}, StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.", TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.", UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", GenericsEndWithComma: "Trailing comma is not allowed at the end of generics.", UnexpectedTypeAnnotation: "Did not expect a type annotation here.", UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", UnsupportedSignatureParameterKind: function(t) {
|
|
3313
3313
|
return "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got " + t.type + ".";
|
|
3314
|
-
}, LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." },
|
|
3315
|
-
function
|
|
3316
|
-
return t && (t.type === "JSXIdentifier" ? t.name : t.type === "JSXNamespacedName" ? t.namespace.name + ":" + t.name.name : t.type === "JSXMemberExpression" ?
|
|
3314
|
+
}, LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Zs = { quot: '"', amp: "&", apos: "'", lt: "<", gt: ">", nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", fnof: "ƒ", circ: "ˆ", tilde: "˜", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", ensp: " ", emsp: " ", thinsp: " ", zwnj: "", zwj: "", lrm: "", rlm: "", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", bull: "•", hellip: "…", permil: "‰", prime: "′", Prime: "″", lsaquo: "‹", rsaquo: "›", oline: "‾", frasl: "⁄", euro: "€", image: "ℑ", weierp: "℘", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "∧", or: "∨", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦" }, tr = /^[\da-fA-F]+$/, er = /^\d+$/;
|
|
3315
|
+
function Ht(t) {
|
|
3316
|
+
return t && (t.type === "JSXIdentifier" ? t.name : t.type === "JSXNamespacedName" ? t.namespace.name + ":" + t.name.name : t.type === "JSXMemberExpression" ? Ht(t.object) + "." + Ht(t.property) : void 0);
|
|
3317
3317
|
}
|
|
3318
3318
|
var Te = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
3319
3319
|
function ti(t) {
|
|
3320
3320
|
if (!t) throw new Error("Assert fail");
|
|
3321
3321
|
}
|
|
3322
|
-
function
|
|
3322
|
+
function ir(t) {
|
|
3323
3323
|
return t === "accessor";
|
|
3324
3324
|
}
|
|
3325
|
-
function
|
|
3325
|
+
function sr(t) {
|
|
3326
3326
|
return t === "in" || t === "out";
|
|
3327
3327
|
}
|
|
3328
3328
|
function Se(t, e) {
|
|
3329
3329
|
return 2 | (t ? 4 : 0) | (e ? 8 : 0);
|
|
3330
3330
|
}
|
|
3331
|
-
function
|
|
3331
|
+
function rr(t) {
|
|
3332
3332
|
if (t.type !== "MemberExpression") return !1;
|
|
3333
3333
|
var e = t.property;
|
|
3334
|
-
return (!t.computed || !(e.type !== "TemplateLiteral" || e.expressions.length > 0)) &&
|
|
3334
|
+
return (!t.computed || !(e.type !== "TemplateLiteral" || e.expressions.length > 0)) && Bi(t.object);
|
|
3335
3335
|
}
|
|
3336
|
-
function
|
|
3337
|
-
return t.type === "Identifier" || t.type === "MemberExpression" && !t.computed &&
|
|
3336
|
+
function Bi(t) {
|
|
3337
|
+
return t.type === "Identifier" || t.type === "MemberExpression" && !t.computed && Bi(t.object);
|
|
3338
3338
|
}
|
|
3339
3339
|
function ei(t) {
|
|
3340
3340
|
return t === "private" || t === "public" || t === "protected";
|
|
3341
3341
|
}
|
|
3342
|
-
function
|
|
3343
|
-
var e = {}, s = e.dts, a = s !== void 0 && s, o = e.allowSatisfies,
|
|
3342
|
+
function ar(t) {
|
|
3343
|
+
var e = {}, s = e.dts, a = s !== void 0 && s, o = e.allowSatisfies, l = o !== void 0 && o;
|
|
3344
3344
|
return function(d) {
|
|
3345
|
-
var v = d.acorn ||
|
|
3346
|
-
function
|
|
3345
|
+
var v = d.acorn || zs, g = Qs(v), h = v.tokTypes, P = v.keywordTypes, N = v.isIdentifierStart, j = v.lineBreak, nt = v.isNewLine, lt = v.tokContexts, _t = v.isIdentifierChar, I = g.tokTypes, Z = g.tokContexts, fe = g.keywordsRegExp, $i = g.tokenIsLiteralPropertyName, Gi = g.tokenIsTemplate, Ki = g.tokenIsTSDeclarationStart, V = g.tokenIsIdentifier, Qt = g.tokenIsKeywordOrIdentifier, Wi = g.tokenIsTSTypeOperator;
|
|
3346
|
+
function zi(S, tt, z) {
|
|
3347
3347
|
z === void 0 && (z = S.length);
|
|
3348
|
-
for (var $ =
|
|
3348
|
+
for (var $ = tt; $ < z; $++) {
|
|
3349
3349
|
var D = S.charCodeAt($);
|
|
3350
3350
|
if (nt(D)) return $ < z - 1 && D === 13 && S.charCodeAt($ + 1) === 10 ? $ + 2 : $ + 1;
|
|
3351
3351
|
}
|
|
3352
3352
|
return -1;
|
|
3353
3353
|
}
|
|
3354
|
-
d = (function(S,
|
|
3355
|
-
var $ = z.tokTypes, D =
|
|
3354
|
+
d = (function(S, tt, z) {
|
|
3355
|
+
var $ = z.tokTypes, D = tt.tokTypes;
|
|
3356
3356
|
return (function(p) {
|
|
3357
3357
|
function i() {
|
|
3358
3358
|
return p.apply(this, arguments) || this;
|
|
3359
3359
|
}
|
|
3360
|
-
|
|
3360
|
+
Zt(i, p);
|
|
3361
3361
|
var r = i.prototype;
|
|
3362
3362
|
return r.takeDecorators = function(n) {
|
|
3363
3363
|
var c = this.decoratorStack[this.decoratorStack.length - 1];
|
|
3364
3364
|
c.length && (n.decorators = c, this.resetStartLocationFromNode(n, c[0]), this.decoratorStack[this.decoratorStack.length - 1] = []);
|
|
3365
3365
|
}, r.parseDecorators = function(n) {
|
|
3366
3366
|
for (var c = this.decoratorStack[this.decoratorStack.length - 1]; this.match(D.at); ) {
|
|
3367
|
-
var
|
|
3368
|
-
c.push(
|
|
3367
|
+
var f = this.parseDecorator();
|
|
3368
|
+
c.push(f);
|
|
3369
3369
|
}
|
|
3370
3370
|
this.match($._export) ? n || this.unexpected() : this.canHaveLeadingDecorator() || this.raise(this.start, "Leading decorators must be attached to a class declaration.");
|
|
3371
3371
|
}, r.parseDecorator = function() {
|
|
3372
3372
|
var n = this.startNode();
|
|
3373
3373
|
this.next(), this.decoratorStack.push([]);
|
|
3374
|
-
var c,
|
|
3374
|
+
var c, f = this.start, m = this.startLoc;
|
|
3375
3375
|
if (this.match($.parenL)) {
|
|
3376
3376
|
var y = this.start, x = this.startLoc;
|
|
3377
3377
|
if (this.next(), c = this.parseExpression(), this.expect($.parenR), this.options.preserveParens) {
|
|
@@ -3379,7 +3379,7 @@ function rr(t) {
|
|
|
3379
3379
|
b.expression = c, c = this.finishNode(b, "ParenthesizedExpression");
|
|
3380
3380
|
}
|
|
3381
3381
|
} else for (c = this.parseIdent(!1); this.eat($.dot); ) {
|
|
3382
|
-
var T = this.startNodeAt(
|
|
3382
|
+
var T = this.startNodeAt(f, m);
|
|
3383
3383
|
T.object = c, T.property = this.parseIdent(!0), T.computed = !1, c = this.finishNode(T, "MemberExpression");
|
|
3384
3384
|
}
|
|
3385
3385
|
return n.expression = this.parseMaybeDecoratorArguments(c), this.decoratorStack.pop(), this.finishNode(n, "Decorator");
|
|
@@ -3391,14 +3391,14 @@ function rr(t) {
|
|
|
3391
3391
|
return n;
|
|
3392
3392
|
}, i;
|
|
3393
3393
|
})(S);
|
|
3394
|
-
})(d, g, v), d = (function(S,
|
|
3395
|
-
var D = S.tokTypes, p =
|
|
3394
|
+
})(d, g, v), d = (function(S, tt, z, $) {
|
|
3395
|
+
var D = S.tokTypes, p = tt.tokTypes, i = S.isNewLine, r = S.isIdentifierChar, n = Object.assign({ allowNamespaces: !0, allowNamespacedObjects: !0 }, {});
|
|
3396
3396
|
return (function(c) {
|
|
3397
|
-
function
|
|
3397
|
+
function f() {
|
|
3398
3398
|
return c.apply(this, arguments) || this;
|
|
3399
3399
|
}
|
|
3400
|
-
|
|
3401
|
-
var m =
|
|
3400
|
+
Zt(f, c);
|
|
3401
|
+
var m = f.prototype;
|
|
3402
3402
|
return m.jsx_readToken = function() {
|
|
3403
3403
|
for (var y = "", x = this.pos; ; ) {
|
|
3404
3404
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated JSX contents");
|
|
@@ -3435,7 +3435,7 @@ function rr(t) {
|
|
|
3435
3435
|
T !== "&" && this.raise(this.pos, "Entity must start with an ampersand");
|
|
3436
3436
|
for (var E = ++this.pos; this.pos < this.input.length && b++ < 10; ) {
|
|
3437
3437
|
if ((T = this.input[this.pos++]) === ";") {
|
|
3438
|
-
x[0] === "#" ? x[1] === "x" ? (x = x.substr(2),
|
|
3438
|
+
x[0] === "#" ? x[1] === "x" ? (x = x.substr(2), tr.test(x) && (y = String.fromCharCode(parseInt(x, 16)))) : (x = x.substr(1), er.test(x) && (y = String.fromCharCode(parseInt(x, 10)))) : y = Zs[x];
|
|
3439
3439
|
break;
|
|
3440
3440
|
}
|
|
3441
3441
|
x += T;
|
|
@@ -3512,7 +3512,7 @@ function rr(t) {
|
|
|
3512
3512
|
default:
|
|
3513
3513
|
this.unexpected();
|
|
3514
3514
|
}
|
|
3515
|
-
|
|
3515
|
+
Ht(L.name) !== Ht(E.name) && this.raise(L.start, "Expected corresponding JSX closing tag for <" + Ht(E.name) + ">");
|
|
3516
3516
|
}
|
|
3517
3517
|
var k = E.name ? "Element" : "Fragment";
|
|
3518
3518
|
return b["opening" + k] = E, b["closing" + k] = L, b.children = T, this.type === D.relational && this.value === "<" && this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"), this.finishNode(b, "JSX" + k);
|
|
@@ -3522,15 +3522,15 @@ function rr(t) {
|
|
|
3522
3522
|
}, m.jsx_parseElement = function() {
|
|
3523
3523
|
var y = this.start, x = this.startLoc;
|
|
3524
3524
|
return this.next(), this.jsx_parseElementAt(y, x);
|
|
3525
|
-
},
|
|
3525
|
+
}, f;
|
|
3526
3526
|
})(z);
|
|
3527
|
-
})(v, g, d), d = (function(S,
|
|
3528
|
-
var $ =
|
|
3527
|
+
})(v, g, d), d = (function(S, tt, z) {
|
|
3528
|
+
var $ = tt.tokTypes, D = z.tokTypes;
|
|
3529
3529
|
return (function(p) {
|
|
3530
3530
|
function i() {
|
|
3531
3531
|
return p.apply(this, arguments) || this;
|
|
3532
3532
|
}
|
|
3533
|
-
|
|
3533
|
+
Zt(i, p);
|
|
3534
3534
|
var r = i.prototype;
|
|
3535
3535
|
return r.parseMaybeImportAttributes = function(n) {
|
|
3536
3536
|
if (this.type === D._with || this.type === $.assert) {
|
|
@@ -3546,33 +3546,33 @@ function rr(t) {
|
|
|
3546
3546
|
var n = [], c = /* @__PURE__ */ new Set();
|
|
3547
3547
|
do {
|
|
3548
3548
|
if (this.type === D.braceR) break;
|
|
3549
|
-
var
|
|
3550
|
-
|
|
3549
|
+
var f, m = this.startNode();
|
|
3550
|
+
f = this.type === D.string ? this.parseLiteral(this.value) : this.parseIdent(!0), this.next(), m.key = f, c.has(m.key.name) && this.raise(this.pos, "Duplicated key in attributes"), c.add(m.key.name), this.type !== D.string && this.raise(this.pos, "Only string is supported as an attribute value"), m.value = this.parseLiteral(this.value), n.push(this.finishNode(m, "ImportAttribute"));
|
|
3551
3551
|
} while (this.eat(D.comma));
|
|
3552
3552
|
return n;
|
|
3553
3553
|
}, i;
|
|
3554
3554
|
})(S);
|
|
3555
3555
|
})(d, g, v);
|
|
3556
|
-
var
|
|
3557
|
-
function
|
|
3556
|
+
var Xi = /* @__PURE__ */ (function(S) {
|
|
3557
|
+
function tt(i, r, n) {
|
|
3558
3558
|
var c;
|
|
3559
|
-
return (c = S.call(this, i, r, n) || this).preValue = null, c.preToken = null, c.isLookahead = !1, c.isAmbientContext = !1, c.inAbstractClass = !1, c.inType = !1, c.inDisallowConditionalTypesContext = !1, c.maybeInArrowParameters = !1, c.shouldParseArrowReturnType = void 0, c.shouldParseAsyncArrowReturnType = void 0, c.decoratorStack = [[]], c.importsStack = [[]], c.importOrExportOuterKind = void 0, c.tsParseConstModifier = c.tsParseModifiers.bind((function(
|
|
3560
|
-
if (
|
|
3561
|
-
return
|
|
3559
|
+
return (c = S.call(this, i, r, n) || this).preValue = null, c.preToken = null, c.isLookahead = !1, c.isAmbientContext = !1, c.inAbstractClass = !1, c.inType = !1, c.inDisallowConditionalTypesContext = !1, c.maybeInArrowParameters = !1, c.shouldParseArrowReturnType = void 0, c.shouldParseAsyncArrowReturnType = void 0, c.decoratorStack = [[]], c.importsStack = [[]], c.importOrExportOuterKind = void 0, c.tsParseConstModifier = c.tsParseModifiers.bind((function(f) {
|
|
3560
|
+
if (f === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3561
|
+
return f;
|
|
3562
3562
|
})(c), { allowedModifiers: ["const"], disallowedModifiers: ["in", "out"], errorTemplate: A.InvalidModifierOnTypeParameterPositions }), c;
|
|
3563
3563
|
}
|
|
3564
|
-
|
|
3565
|
-
var z, $, D, p =
|
|
3564
|
+
Zt(tt, S);
|
|
3565
|
+
var z, $, D, p = tt.prototype;
|
|
3566
3566
|
return p.getTokenFromCodeInType = function(i) {
|
|
3567
3567
|
return i === 62 || i === 60 ? this.finishOp(h.relational, 1) : S.prototype.getTokenFromCode.call(this, i);
|
|
3568
3568
|
}, p.readToken = function(i) {
|
|
3569
3569
|
if (!this.inType) {
|
|
3570
3570
|
var r = this.curContext();
|
|
3571
|
-
if (r ===
|
|
3572
|
-
if (r ===
|
|
3571
|
+
if (r === Z.tc_expr) return this.jsx_readToken();
|
|
3572
|
+
if (r === Z.tc_oTag || r === Z.tc_cTag) {
|
|
3573
3573
|
if (N(i)) return this.jsx_readWord();
|
|
3574
3574
|
if (i == 62) return ++this.pos, this.finishToken(I.jsxTagEnd);
|
|
3575
|
-
if ((i === 34 || i === 39) && r ==
|
|
3575
|
+
if ((i === 34 || i === 39) && r == Z.tc_oTag) return this.jsx_readString(i);
|
|
3576
3576
|
}
|
|
3577
3577
|
if (i === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) return ++this.pos, this.finishToken(I.jsxTagStart);
|
|
3578
3578
|
}
|
|
@@ -3587,14 +3587,14 @@ function rr(t) {
|
|
|
3587
3587
|
r === void 0 && (r = this.cloneCurLookaheadState());
|
|
3588
3588
|
var n = { node: null };
|
|
3589
3589
|
try {
|
|
3590
|
-
return { node: i(function(
|
|
3591
|
-
throw
|
|
3590
|
+
return { node: i(function(f) {
|
|
3591
|
+
throw f === void 0 && (f = null), n.node = f, n;
|
|
3592
3592
|
}), error: null, thrown: !1, aborted: !1, failState: null };
|
|
3593
|
-
} catch (
|
|
3593
|
+
} catch (f) {
|
|
3594
3594
|
var c = this.getCurLookaheadState();
|
|
3595
|
-
if (this.setLookaheadState(r),
|
|
3596
|
-
if (
|
|
3597
|
-
throw
|
|
3595
|
+
if (this.setLookaheadState(r), f instanceof SyntaxError) return { node: null, error: f, thrown: !0, aborted: !1, failState: c };
|
|
3596
|
+
if (f === n) return { node: n.node, error: null, thrown: !1, aborted: !0, failState: c };
|
|
3597
|
+
throw f;
|
|
3598
3598
|
}
|
|
3599
3599
|
}, p.setOptionalParametersError = function(i, r) {
|
|
3600
3600
|
var n;
|
|
@@ -3630,13 +3630,13 @@ function rr(t) {
|
|
|
3630
3630
|
}, p.tsTryParseGenericAsyncArrowFunction = function(i, r, n) {
|
|
3631
3631
|
var c = this;
|
|
3632
3632
|
if (this.tsMatchLeftRelational()) {
|
|
3633
|
-
var
|
|
3633
|
+
var f = this.maybeInArrowParameters;
|
|
3634
3634
|
this.maybeInArrowParameters = !0;
|
|
3635
3635
|
var m = this.tsTryParseAndCatch(function() {
|
|
3636
3636
|
var y = c.startNodeAt(i, r);
|
|
3637
3637
|
return y.typeParameters = c.tsParseTypeParameters(), S.prototype.parseFunctionParams.call(c, y), y.returnType = c.tsTryParseTypeOrTypePredicateAnnotation(), c.expect(h.arrow), y;
|
|
3638
3638
|
});
|
|
3639
|
-
if (this.maybeInArrowParameters =
|
|
3639
|
+
if (this.maybeInArrowParameters = f, m) return S.prototype.parseArrowExpression.call(this, m, null, !0, n);
|
|
3640
3640
|
}
|
|
3641
3641
|
}, p.tsParseTypeArgumentsInExpression = function() {
|
|
3642
3642
|
if (this.reScan_lt() === h.relational) return this.tsParseTypeArguments();
|
|
@@ -3665,8 +3665,8 @@ function rr(t) {
|
|
|
3665
3665
|
return this.input.charCodeAt(this.nextTokenStart());
|
|
3666
3666
|
}, p.compareLookaheadState = function(i, r) {
|
|
3667
3667
|
for (var n = 0, c = Object.keys(i); n < c.length; n++) {
|
|
3668
|
-
var
|
|
3669
|
-
if (i[
|
|
3668
|
+
var f = c[n];
|
|
3669
|
+
if (i[f] !== r[f]) return !1;
|
|
3670
3670
|
}
|
|
3671
3671
|
return !0;
|
|
3672
3672
|
}, p.createLookaheadState = function() {
|
|
@@ -3694,7 +3694,7 @@ function rr(t) {
|
|
|
3694
3694
|
var i;
|
|
3695
3695
|
this.isLookahead || (i = this.options.onComment && this.curPosition());
|
|
3696
3696
|
var r = this.pos, n = this.input.indexOf("*/", this.pos += 2);
|
|
3697
|
-
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var c,
|
|
3697
|
+
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var c, f = r; (c = zi(this.input, f, this.pos)) > -1; ) ++this.curLine, f = this.lineStart = c;
|
|
3698
3698
|
this.isLookahead || this.options.onComment && this.options.onComment(!0, this.input.slice(r + 2, n), r, this.pos, i, this.curPosition());
|
|
3699
3699
|
}, p.skipLineComment = function(i) {
|
|
3700
3700
|
var r, n = this.pos;
|
|
@@ -3713,13 +3713,13 @@ function rr(t) {
|
|
|
3713
3713
|
return Ye.lastIndex = this.end, Ye.test(this.input);
|
|
3714
3714
|
}, p.addExtra = function(i, r, n, c) {
|
|
3715
3715
|
if (c === void 0 && (c = !0), i) {
|
|
3716
|
-
var
|
|
3717
|
-
c ?
|
|
3716
|
+
var f = i.extra = i.extra || {};
|
|
3717
|
+
c ? f[r] = n : Object.defineProperty(f, r, { enumerable: c, value: n });
|
|
3718
3718
|
}
|
|
3719
3719
|
}, p.isLiteralPropertyName = function() {
|
|
3720
|
-
return
|
|
3720
|
+
return $i(this.type);
|
|
3721
3721
|
}, p.hasPrecedingLineBreak = function() {
|
|
3722
|
-
return
|
|
3722
|
+
return j.test(this.input.slice(this.lastTokEndLoc.index, this.start));
|
|
3723
3723
|
}, p.createIdentifier = function(i, r) {
|
|
3724
3724
|
return i.name = r, this.finishNode(i, "Identifier");
|
|
3725
3725
|
}, p.resetStartLocationFromNode = function(i, r) {
|
|
@@ -3768,7 +3768,7 @@ function rr(t) {
|
|
|
3768
3768
|
return !1;
|
|
3769
3769
|
}
|
|
3770
3770
|
if (!this.isContextualWithState(i, n)) return !1;
|
|
3771
|
-
for (var
|
|
3771
|
+
for (var f = 0; f < r; f++) this.next();
|
|
3772
3772
|
return !0;
|
|
3773
3773
|
}, p.canHaveLeadingDecorator = function() {
|
|
3774
3774
|
return this.match(h._class);
|
|
@@ -3799,7 +3799,7 @@ function rr(t) {
|
|
|
3799
3799
|
}
|
|
3800
3800
|
return this.next(), S.prototype.exitScope.call(this), this.finishNode(i, "TSModuleBlock");
|
|
3801
3801
|
}, p.tsParseAmbientExternalModuleDeclaration = function(i) {
|
|
3802
|
-
return this.ts_isContextual(I.global) ? (i.global = !0, i.id = this.parseIdent()) : this.match(h.string) ? i.id = this.parseLiteral(this.value) : this.unexpected(), this.match(h.braceL) ? (S.prototype.enterScope.call(this,
|
|
3802
|
+
return this.ts_isContextual(I.global) ? (i.global = !0, i.id = this.parseIdent()) : this.match(h.string) ? i.id = this.parseLiteral(this.value) : this.unexpected(), this.match(h.braceL) ? (S.prototype.enterScope.call(this, jt), i.body = this.tsParseModuleBlock(), S.prototype.exitScope.call(this)) : S.prototype.semicolon.call(this), this.finishNode(i, "TSModuleDeclaration");
|
|
3803
3803
|
}, p.tsTryParseDeclare = function(i) {
|
|
3804
3804
|
var r = this;
|
|
3805
3805
|
if (!this.isLineTerminator()) {
|
|
@@ -3811,8 +3811,8 @@ function rr(t) {
|
|
|
3811
3811
|
if (c === I.global) return r.tsParseAmbientExternalModuleDeclaration(i);
|
|
3812
3812
|
if (c === h._const || c === h._var) return r.match(h._const) && r.isLookaheadContextual("enum") ? (r.expect(h._const), r.tsParseEnumDeclaration(i, { const: !0, declare: !0 })) : (i.declare = !0, r.parseVarStatement(i, n || r.value, !0));
|
|
3813
3813
|
if (c === I.interface) {
|
|
3814
|
-
var
|
|
3815
|
-
if (
|
|
3814
|
+
var f = r.tsParseInterfaceDeclaration(i, { declare: !0 });
|
|
3815
|
+
if (f) return f;
|
|
3816
3816
|
}
|
|
3817
3817
|
return V(c) ? r.tsParseDeclaration(i, r.value, !0) : void 0;
|
|
3818
3818
|
});
|
|
@@ -3830,25 +3830,25 @@ function rr(t) {
|
|
|
3830
3830
|
return this.tsMatchRightRelational();
|
|
3831
3831
|
}
|
|
3832
3832
|
}, p.tsParseDelimitedListWorker = function(i, r, n, c) {
|
|
3833
|
-
for (var
|
|
3833
|
+
for (var f = [], m = -1; !this.tsIsListTerminator(i); ) {
|
|
3834
3834
|
m = -1;
|
|
3835
3835
|
var y = r();
|
|
3836
3836
|
if (y == null) return;
|
|
3837
|
-
if (
|
|
3837
|
+
if (f.push(y), !this.eat(h.comma)) {
|
|
3838
3838
|
if (this.tsIsListTerminator(i)) break;
|
|
3839
3839
|
return void (n && this.expect(h.comma));
|
|
3840
3840
|
}
|
|
3841
3841
|
m = this.lastTokStart;
|
|
3842
3842
|
}
|
|
3843
|
-
return c && (c.value = m),
|
|
3843
|
+
return c && (c.value = m), f;
|
|
3844
3844
|
}, p.tsParseDelimitedList = function(i, r, n) {
|
|
3845
3845
|
return (function(c) {
|
|
3846
3846
|
if (c == null) throw new Error("Unexpected " + c + " value.");
|
|
3847
3847
|
return c;
|
|
3848
3848
|
})(this.tsParseDelimitedListWorker(i, r, !0, n));
|
|
3849
|
-
}, p.tsParseBracketedList = function(i, r, n, c,
|
|
3849
|
+
}, p.tsParseBracketedList = function(i, r, n, c, f) {
|
|
3850
3850
|
c || this.expect(n ? h.bracketL : h.relational);
|
|
3851
|
-
var m = this.tsParseDelimitedList(i, r,
|
|
3851
|
+
var m = this.tsParseDelimitedList(i, r, f);
|
|
3852
3852
|
return this.expect(n ? h.bracketR : h.relational), m;
|
|
3853
3853
|
}, p.tsParseTypeParameterName = function() {
|
|
3854
3854
|
return this.parseIdent().name;
|
|
@@ -3929,15 +3929,15 @@ function rr(t) {
|
|
|
3929
3929
|
return this.tsInType(function() {
|
|
3930
3930
|
var n = r.startNode();
|
|
3931
3931
|
r.expect(i);
|
|
3932
|
-
var c = r.startNode(),
|
|
3933
|
-
if (
|
|
3932
|
+
var c = r.startNode(), f = !!r.tsTryParse(r.tsParseTypePredicateAsserts.bind(r));
|
|
3933
|
+
if (f && r.match(h._this)) {
|
|
3934
3934
|
var m = r.tsParseThisTypeOrThisTypePredicate();
|
|
3935
3935
|
return m.type === "TSThisType" ? (c.parameterName = m, c.asserts = !0, c.typeAnnotation = null, m = r.finishNode(c, "TSTypePredicate")) : (r.resetStartLocationFromNode(m, c), m.asserts = !0), n.typeAnnotation = m, r.finishNode(n, "TSTypeAnnotation");
|
|
3936
3936
|
}
|
|
3937
3937
|
var y = r.tsIsIdentifier() && r.tsTryParse(r.tsParseTypePredicatePrefix.bind(r));
|
|
3938
|
-
if (!y) return
|
|
3938
|
+
if (!y) return f ? (c.parameterName = r.parseIdent(), c.asserts = f, c.typeAnnotation = null, n.typeAnnotation = r.finishNode(c, "TSTypePredicate"), r.finishNode(n, "TSTypeAnnotation")) : r.tsParseTypeAnnotation(!1, n);
|
|
3939
3939
|
var x = r.tsParseTypeAnnotation(!1);
|
|
3940
|
-
return c.parameterName = y, c.typeAnnotation = x, c.asserts =
|
|
3940
|
+
return c.parameterName = y, c.typeAnnotation = x, c.asserts = f, n.typeAnnotation = r.finishNode(c, "TSTypePredicate"), r.finishNode(n, "TSTypeAnnotation");
|
|
3941
3941
|
});
|
|
3942
3942
|
}, p.tsFillSignature = function(i, r) {
|
|
3943
3943
|
var n = i === h.arrow;
|
|
@@ -3953,11 +3953,11 @@ function rr(t) {
|
|
|
3953
3953
|
return n.tsFillSignature(h.arrow, c);
|
|
3954
3954
|
}), this.finishNode(c, i);
|
|
3955
3955
|
}, p.tsParseUnionOrIntersectionType = function(i, r, n) {
|
|
3956
|
-
var c = this.startNode(),
|
|
3956
|
+
var c = this.startNode(), f = this.eat(n), m = [];
|
|
3957
3957
|
do
|
|
3958
3958
|
m.push(r());
|
|
3959
3959
|
while (this.eat(n));
|
|
3960
|
-
return m.length !== 1 ||
|
|
3960
|
+
return m.length !== 1 || f ? (c.types = m, this.finishNode(c, i)) : m[0];
|
|
3961
3961
|
}, p.tsCheckTypeAnnotationForReadOnly = function(i) {
|
|
3962
3962
|
switch (i.typeAnnotation.type) {
|
|
3963
3963
|
case "TSTupleType":
|
|
@@ -4013,11 +4013,11 @@ function rr(t) {
|
|
|
4013
4013
|
var i = this.startNode();
|
|
4014
4014
|
return i.members = this.tsParseObjectTypeMembers(), this.finishNode(i, "TSTypeLiteral");
|
|
4015
4015
|
}, p.tsParseTupleElementType = function() {
|
|
4016
|
-
var i = this.startLoc, r = this.start, n = this.eat(h.ellipsis), c = this.tsParseType(),
|
|
4016
|
+
var i = this.startLoc, r = this.start, n = this.eat(h.ellipsis), c = this.tsParseType(), f = this.eat(h.question);
|
|
4017
4017
|
if (this.eat(h.colon)) {
|
|
4018
4018
|
var m = this.startNodeAtNode(c);
|
|
4019
|
-
m.optional =
|
|
4020
|
-
} else if (
|
|
4019
|
+
m.optional = f, c.type !== "TSTypeReference" || c.typeParameters || c.typeName.type !== "Identifier" ? (this.raise(c.start, A.InvalidTupleMemberLabel), m.label = c) : m.label = c.typeName, m.elementType = this.tsParseType(), c = this.finishNode(m, "TSNamedTupleMember");
|
|
4020
|
+
} else if (f) {
|
|
4021
4021
|
var y = this.startNodeAtNode(c);
|
|
4022
4022
|
y.typeAnnotation = c, c = this.finishNode(y, "TSOptionalType");
|
|
4023
4023
|
}
|
|
@@ -4030,13 +4030,13 @@ function rr(t) {
|
|
|
4030
4030
|
var i = this, r = this.startNode();
|
|
4031
4031
|
r.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), !0, !1);
|
|
4032
4032
|
var n = !1, c = null;
|
|
4033
|
-
return r.elementTypes.forEach(function(
|
|
4034
|
-
var m =
|
|
4035
|
-
!n || m === "TSRestType" || m === "TSOptionalType" || m === "TSNamedTupleMember" &&
|
|
4033
|
+
return r.elementTypes.forEach(function(f) {
|
|
4034
|
+
var m = f.type;
|
|
4035
|
+
!n || m === "TSRestType" || m === "TSOptionalType" || m === "TSNamedTupleMember" && f.optional || i.raise(f.start, A.OptionalTypeBeforeRequired), n || (n = m === "TSNamedTupleMember" && f.optional || m === "TSOptionalType");
|
|
4036
4036
|
var y = m;
|
|
4037
|
-
m === "TSRestType" && (y = (
|
|
4037
|
+
m === "TSRestType" && (y = (f = f.typeAnnotation).type);
|
|
4038
4038
|
var x = y === "TSNamedTupleMember";
|
|
4039
|
-
c != null || (c = x), c !== x && i.raise(
|
|
4039
|
+
c != null || (c = x), c !== x && i.raise(f.start, A.MixedLabeledAndUnlabeledElements);
|
|
4040
4040
|
}), this.finishNode(r, "TSTupleType");
|
|
4041
4041
|
}, p.tsParseTemplateLiteralType = function() {
|
|
4042
4042
|
var i = this.startNode();
|
|
@@ -4082,8 +4082,8 @@ function rr(t) {
|
|
|
4082
4082
|
default:
|
|
4083
4083
|
var r = this.type;
|
|
4084
4084
|
if (V(r) || r === h._void || r === h._null) {
|
|
4085
|
-
var n = r === h._void ? "TSVoidKeyword" : r === h._null ? "TSNullKeyword" : (function(
|
|
4086
|
-
switch (
|
|
4085
|
+
var n = r === h._void ? "TSVoidKeyword" : r === h._null ? "TSNullKeyword" : (function(f) {
|
|
4086
|
+
switch (f) {
|
|
4087
4087
|
case "any":
|
|
4088
4088
|
return "TSAnyKeyword";
|
|
4089
4089
|
case "boolean":
|
|
@@ -4127,7 +4127,7 @@ function rr(t) {
|
|
|
4127
4127
|
return i;
|
|
4128
4128
|
}, p.tsParseTypeOperatorOrHigher = function() {
|
|
4129
4129
|
var i = this;
|
|
4130
|
-
return
|
|
4130
|
+
return Wi(this.type) && !this.containsEsc ? this.tsParseTypeOperator() : this.isContextual("infer") ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(function() {
|
|
4131
4131
|
return i.tsParseArrayTypeOrHigher();
|
|
4132
4132
|
});
|
|
4133
4133
|
}, p.tsParseIntersectionTypeOrHigher = function() {
|
|
@@ -4196,19 +4196,19 @@ function rr(t) {
|
|
|
4196
4196
|
}
|
|
4197
4197
|
}
|
|
4198
4198
|
}, p.tsParseModifiersByMap = function(i) {
|
|
4199
|
-
for (var r = i.modified, n = i.map, c = 0,
|
|
4200
|
-
var m =
|
|
4199
|
+
for (var r = i.modified, n = i.map, c = 0, f = Object.keys(n); c < f.length; c++) {
|
|
4200
|
+
var m = f[c];
|
|
4201
4201
|
r[m] = n[m];
|
|
4202
4202
|
}
|
|
4203
4203
|
}, p.tsParseModifiers = function(i) {
|
|
4204
|
-
for (var r = this, n = i.modified, c = i.allowedModifiers,
|
|
4205
|
-
|
|
4206
|
-
}, E = function(U,
|
|
4207
|
-
(n[q] &&
|
|
4204
|
+
for (var r = this, n = i.modified, c = i.allowedModifiers, f = i.disallowedModifiers, m = i.stopOnStartOfClassStaticBlock, y = i.errorTemplate, x = y === void 0 ? A.InvalidModifierOnTypeMember : y, b = {}, T = function(U, B, q, G) {
|
|
4205
|
+
B === q && n[G] && r.raise(U.column, A.InvalidModifiersOrder({ orderedModifiers: [q, G] }));
|
|
4206
|
+
}, E = function(U, B, q, G) {
|
|
4207
|
+
(n[q] && B === G || n[G] && B === q) && r.raise(U.column, A.IncompatibleModifiers({ modifiers: [q, G] }));
|
|
4208
4208
|
}; ; ) {
|
|
4209
|
-
var L = this.startLoc, k = this.tsParseModifier(c.concat(
|
|
4209
|
+
var L = this.startLoc, k = this.tsParseModifier(c.concat(f ?? []), m);
|
|
4210
4210
|
if (!k) break;
|
|
4211
|
-
ei(k) ? n.accessibility ? this.raise(this.start, A.DuplicateAccessibilityModifier()) : (T(L, k, k, "override"), T(L, k, k, "static"), T(L, k, k, "readonly"), T(L, k, k, "accessor"), b.accessibility = k, n.accessibility = k) :
|
|
4211
|
+
ei(k) ? n.accessibility ? this.raise(this.start, A.DuplicateAccessibilityModifier()) : (T(L, k, k, "override"), T(L, k, k, "static"), T(L, k, k, "readonly"), T(L, k, k, "accessor"), b.accessibility = k, n.accessibility = k) : sr(k) ? n[k] ? this.raise(this.start, A.DuplicateModifier({ modifier: k })) : (T(L, k, "in", "out"), b[k] = k, n[k] = !0) : ir(k) ? n[k] ? this.raise(this.start, A.DuplicateModifier({ modifier: k })) : (E(L, k, "accessor", "readonly"), E(L, k, "accessor", "static"), E(L, k, "accessor", "override"), b[k] = k, n[k] = !0) : Object.hasOwnProperty.call(n, k) ? this.raise(this.start, A.DuplicateModifier({ modifier: k })) : (T(L, k, "static", "readonly"), T(L, k, "static", "override"), T(L, k, "override", "readonly"), T(L, k, "abstract", "override"), E(L, k, "declare", "override"), E(L, k, "static", "abstract"), b[k] = k, n[k] = !0), f != null && f.includes(k) && this.raise(this.start, x);
|
|
4212
4212
|
}
|
|
4213
4213
|
return b;
|
|
4214
4214
|
}, p.tsParseInOutModifiers = function(i) {
|
|
@@ -4222,8 +4222,8 @@ function rr(t) {
|
|
|
4222
4222
|
}), r.params.length === 0 && this.raise(this.start, A.EmptyTypeArguments), this.exprAllowed = !1, this.expect(h.relational), this.finishNode(r, "TSTypeParameterInstantiation");
|
|
4223
4223
|
}, p.tsParseHeritageClause = function(i) {
|
|
4224
4224
|
var r = this, n = this.start, c = this.tsParseDelimitedList("HeritageClauseElement", function() {
|
|
4225
|
-
var
|
|
4226
|
-
return
|
|
4225
|
+
var f = r.startNode();
|
|
4226
|
+
return f.expression = r.tsParseEntityName(), r.tsMatchLeftRelational() && (f.typeParameters = r.tsParseTypeArguments()), r.finishNode(f, "TSExpressionWithTypeArguments");
|
|
4227
4227
|
});
|
|
4228
4228
|
return c.length || this.raise(n, A.EmptyHeritageClauseType({ token: i })), c;
|
|
4229
4229
|
}, p.tsParseTypeMemberSemicolon = function() {
|
|
@@ -4242,12 +4242,12 @@ function rr(t) {
|
|
|
4242
4242
|
r && this.raise(i.start, A.ReadonlyForMethodSignature);
|
|
4243
4243
|
var c = n;
|
|
4244
4244
|
c.kind && this.tsMatchLeftRelational() && this.raise(this.start, A.AccesorCannotHaveTypeParameters), this.tsFillSignature(h.colon, c), this.tsParseTypeMemberSemicolon();
|
|
4245
|
-
var
|
|
4246
|
-
if (c.kind === "get") c[
|
|
4245
|
+
var f = "parameters", m = "typeAnnotation";
|
|
4246
|
+
if (c.kind === "get") c[f].length > 0 && (this.raise(this.start, "A 'get' accesor must not have any formal parameters."), this.isThisParam(c[f][0]) && this.raise(this.start, A.AccesorCannotDeclareThisParameter));
|
|
4247
4247
|
else if (c.kind === "set") {
|
|
4248
|
-
if (c[
|
|
4248
|
+
if (c[f].length !== 1) this.raise(this.start, "A 'get' accesor must not have any formal parameters.");
|
|
4249
4249
|
else {
|
|
4250
|
-
var y = c[
|
|
4250
|
+
var y = c[f][0];
|
|
4251
4251
|
this.isThisParam(y) && this.raise(this.start, A.AccesorCannotDeclareThisParameter), y.type === "Identifier" && y.optional && this.raise(this.start, A.SetAccesorCannotHaveOptionalParameter), y.type === "RestElement" && this.raise(this.start, A.SetAccesorCannotHaveRestParameter);
|
|
4252
4252
|
}
|
|
4253
4253
|
c[m] && this.raise(c[m].start, A.SetAccesorCannotHaveReturnType);
|
|
@@ -4284,7 +4284,7 @@ function rr(t) {
|
|
|
4284
4284
|
if (!this.hasFollowingLineBreak()) return i.abstract = !0, this.tsParseInterfaceDeclaration(i);
|
|
4285
4285
|
} else this.unexpected(i.start);
|
|
4286
4286
|
}, p.tsIsDeclarationStart = function() {
|
|
4287
|
-
return
|
|
4287
|
+
return Ki(this.type);
|
|
4288
4288
|
}, p.tsParseExpressionStatement = function(i, r) {
|
|
4289
4289
|
switch (r.name) {
|
|
4290
4290
|
case "declare":
|
|
@@ -4293,7 +4293,7 @@ function rr(t) {
|
|
|
4293
4293
|
break;
|
|
4294
4294
|
case "global":
|
|
4295
4295
|
if (this.match(h.braceL)) {
|
|
4296
|
-
S.prototype.enterScope.call(this,
|
|
4296
|
+
S.prototype.enterScope.call(this, jt);
|
|
4297
4297
|
var c = i;
|
|
4298
4298
|
return c.global = !0, c.id = r, c.body = this.tsParseModuleBlock(), S.prototype.exitScope.call(this), this.finishNode(c, "TSModuleDeclaration");
|
|
4299
4299
|
}
|
|
@@ -4312,10 +4312,10 @@ function rr(t) {
|
|
|
4312
4312
|
if (V(c.type) && !this.isContextualWithState("from", c) || c.type === h.braceL) return !1;
|
|
4313
4313
|
}
|
|
4314
4314
|
} else if (!this.match(h._default)) return !1;
|
|
4315
|
-
var
|
|
4316
|
-
if (this.input.charCodeAt(
|
|
4315
|
+
var f = this.nextTokenStart(), m = this.isUnparsedContextual(f, "from");
|
|
4316
|
+
if (this.input.charCodeAt(f) === 44 || V(this.type) && m) return !0;
|
|
4317
4317
|
if (this.match(h._default) && m) {
|
|
4318
|
-
var y = this.input.charCodeAt(this.nextTokenStartSince(
|
|
4318
|
+
var y = this.input.charCodeAt(this.nextTokenStartSince(f + 4));
|
|
4319
4319
|
return y === 34 || y === 39;
|
|
4320
4320
|
}
|
|
4321
4321
|
return !1;
|
|
@@ -4333,7 +4333,7 @@ function rr(t) {
|
|
|
4333
4333
|
if (r === void 0 && (r = !1), i.id = this.parseIdent(), r || this.checkLValSimple(i.id, 8), this.eat(h.dot)) {
|
|
4334
4334
|
var n = this.startNode();
|
|
4335
4335
|
this.tsParseModuleOrNamespaceDeclaration(n, !0), i.body = n;
|
|
4336
|
-
} else S.prototype.enterScope.call(this,
|
|
4336
|
+
} else S.prototype.enterScope.call(this, jt), i.body = this.tsParseModuleBlock(), S.prototype.exitScope.call(this);
|
|
4337
4337
|
return this.finishNode(i, "TSModuleDeclaration");
|
|
4338
4338
|
}, p.checkLValSimple = function(i, r, n) {
|
|
4339
4339
|
return r === void 0 && (r = 0), S.prototype.checkLValSimple.call(this, i, r, n);
|
|
@@ -4382,25 +4382,25 @@ function rr(t) {
|
|
|
4382
4382
|
var n = this.nextTokenStart(), c = this.isUnparsedContextual(n, "from");
|
|
4383
4383
|
if (this.input.charCodeAt(n) === 44 || V(this.type) && c) return !0;
|
|
4384
4384
|
if (this.match(h._default) && c) {
|
|
4385
|
-
var
|
|
4386
|
-
return
|
|
4385
|
+
var f = this.input.charCodeAt(this.nextTokenStartSince(n + 4));
|
|
4386
|
+
return f === 34 || f === 39;
|
|
4387
4387
|
}
|
|
4388
4388
|
return !1;
|
|
4389
4389
|
}, p.parseTemplate = function(i) {
|
|
4390
4390
|
var r = (i === void 0 ? {} : i).isTagged, n = r !== void 0 && r, c = this.startNode();
|
|
4391
4391
|
this.next(), c.expressions = [];
|
|
4392
|
-
var
|
|
4393
|
-
for (c.quasis = [
|
|
4392
|
+
var f = this.parseTemplateElement({ isTagged: n });
|
|
4393
|
+
for (c.quasis = [f]; !f.tail; ) this.type === h.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(h.dollarBraceL), c.expressions.push(this.inType ? this.tsParseType() : this.parseExpression()), this.expect(h.braceR), c.quasis.push(f = this.parseTemplateElement({ isTagged: n }));
|
|
4394
4394
|
return this.next(), this.finishNode(c, "TemplateLiteral");
|
|
4395
|
-
}, p.parseFunction = function(i, r, n, c,
|
|
4395
|
+
}, p.parseFunction = function(i, r, n, c, f) {
|
|
4396
4396
|
this.initFunction(i), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !c) && (this.type === h.star && 2 & r && this.unexpected(), i.generator = this.eat(h.star)), this.options.ecmaVersion >= 8 && (i.async = !!c), 1 & r && (i.id = 4 & r && this.type !== h.name ? null : this.parseIdent());
|
|
4397
4397
|
var m = this.yieldPos, y = this.awaitPos, x = this.awaitIdentPos, b = this.maybeInArrowParameters;
|
|
4398
4398
|
this.maybeInArrowParameters = !1, this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Se(i.async, i.generator)), 1 & r || (i.id = this.type === h.name ? this.parseIdent() : null), this.parseFunctionParams(i);
|
|
4399
4399
|
var T = 1 & r;
|
|
4400
|
-
return this.parseFunctionBody(i, n, !1,
|
|
4401
|
-
}, p.parseFunctionBody = function(i, r, n, c,
|
|
4400
|
+
return this.parseFunctionBody(i, n, !1, f, { isFunctionDeclaration: T }), this.yieldPos = m, this.awaitPos = y, this.awaitIdentPos = x, 1 & r && i.id && !(2 & r) && this.checkLValSimple(i.id, i.body ? this.strict || i.generator || i.async ? this.treatFunctionsAsVar ? 1 : 2 : 3 : 0), this.maybeInArrowParameters = b, this.finishNode(i, T ? "FunctionDeclaration" : "FunctionExpression");
|
|
4401
|
+
}, p.parseFunctionBody = function(i, r, n, c, f) {
|
|
4402
4402
|
r === void 0 && (r = !1), n === void 0 && (n = !1), c === void 0 && (c = !1), this.match(h.colon) && (i.returnType = this.tsParseTypeOrTypePredicateAnnotation(h.colon));
|
|
4403
|
-
var m =
|
|
4403
|
+
var m = f != null && f.isFunctionDeclaration ? "TSDeclareFunction" : f != null && f.isClassMethod ? "TSDeclareMethod" : void 0;
|
|
4404
4404
|
return m && !this.match(h.braceL) && this.isLineTerminator() ? this.finishNode(i, m) : m === "TSDeclareFunction" && this.isAmbientContext && (this.raise(i.start, A.DeclareFunctionHasImplementation), i.declare) ? (S.prototype.parseFunctionBody.call(this, i, r, n, !1), this.finishNode(i, m)) : (S.prototype.parseFunctionBody.call(this, i, r, n, c), i);
|
|
4405
4405
|
}, p.parseNew = function() {
|
|
4406
4406
|
var i;
|
|
@@ -4411,19 +4411,19 @@ function rr(t) {
|
|
|
4411
4411
|
var c = this.containsEsc;
|
|
4412
4412
|
return r.property = this.parseIdent(!0), r.property.name !== "target" && this.raiseRecoverable(r.property.start, "The only valid meta property for new is 'new.target'"), c && this.raiseRecoverable(r.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(r.start, "'new.target' can only be used in functions and class static block"), this.finishNode(r, "MetaProperty");
|
|
4413
4413
|
}
|
|
4414
|
-
var
|
|
4415
|
-
r.callee = this.parseSubscripts(this.parseExprAtom(),
|
|
4414
|
+
var f = this.start, m = this.startLoc, y = this.type === h._import;
|
|
4415
|
+
r.callee = this.parseSubscripts(this.parseExprAtom(), f, m, !0, !1), y && r.callee.type === "ImportExpression" && this.raise(f, "Cannot use new with import()");
|
|
4416
4416
|
var x = r.callee;
|
|
4417
4417
|
return x.type !== "TSInstantiationExpression" || (i = x.extra) != null && i.parenthesized || (r.typeParameters = x.typeParameters, r.callee = x.expression), r.arguments = this.eat(h.parenL) ? this.parseExprList(h.parenR, this.options.ecmaVersion >= 8, !1) : [], this.finishNode(r, "NewExpression");
|
|
4418
|
-
}, p.parseExprOp = function(i, r, n, c,
|
|
4418
|
+
}, p.parseExprOp = function(i, r, n, c, f) {
|
|
4419
4419
|
var m;
|
|
4420
|
-
if (h._in.binop > c && !this.hasPrecedingLineBreak() && (this.isContextual("as") && (m = "TSAsExpression"),
|
|
4420
|
+
if (h._in.binop > c && !this.hasPrecedingLineBreak() && (this.isContextual("as") && (m = "TSAsExpression"), l && this.isContextual("satisfies") && (m = "TSSatisfiesExpression"), m)) {
|
|
4421
4421
|
var y = this.startNodeAt(r, n);
|
|
4422
4422
|
y.expression = i;
|
|
4423
4423
|
var x = this.tsTryNextParseConstantContext();
|
|
4424
|
-
return y.typeAnnotation = x || this.tsNextThenParseType(), this.finishNode(y, m), this.reScan_lt_gt(), this.parseExprOp(y, r, n, c,
|
|
4424
|
+
return y.typeAnnotation = x || this.tsNextThenParseType(), this.finishNode(y, m), this.reScan_lt_gt(), this.parseExprOp(y, r, n, c, f);
|
|
4425
4425
|
}
|
|
4426
|
-
return S.prototype.parseExprOp.call(this, i, r, n, c,
|
|
4426
|
+
return S.prototype.parseExprOp.call(this, i, r, n, c, f);
|
|
4427
4427
|
}, p.parseImportSpecifiers = function() {
|
|
4428
4428
|
var i = [], r = !0;
|
|
4429
4429
|
if (g.tokenIsIdentifier(this.type) && (i.push(this.parseImportDefaultSpecifier()), !this.eat(h.comma))) return i;
|
|
@@ -4475,8 +4475,8 @@ function rr(t) {
|
|
|
4475
4475
|
return this.importOrExportOuterKind = void 0, c;
|
|
4476
4476
|
}
|
|
4477
4477
|
if (this.ts_eatWithState(h.eq, 2, n)) {
|
|
4478
|
-
var
|
|
4479
|
-
return
|
|
4478
|
+
var f = i;
|
|
4479
|
+
return f.expression = this.parseExpression(), this.semicolon(), this.importOrExportOuterKind = void 0, this.finishNode(f, "TSExportAssignment");
|
|
4480
4480
|
}
|
|
4481
4481
|
if (this.ts_eatContextualWithState("as", 2, n)) {
|
|
4482
4482
|
var m = i;
|
|
@@ -4516,11 +4516,11 @@ function rr(t) {
|
|
|
4516
4516
|
if (this.type === I.jsxTagStart) return this.jsx_parseElement();
|
|
4517
4517
|
if (this.type === I.at) return this.parseDecorators(), this.parseExprAtom();
|
|
4518
4518
|
if (V(this.type)) {
|
|
4519
|
-
var c = this.potentialArrowAt === this.start,
|
|
4520
|
-
if (this.options.ecmaVersion >= 8 && !y && x.name === "async" && !this.canInsertSemicolon() && this.eat(h._function)) return this.overrideContext(lt.f_expr), this.parseFunction(this.startNodeAt(
|
|
4519
|
+
var c = this.potentialArrowAt === this.start, f = this.start, m = this.startLoc, y = this.containsEsc, x = this.parseIdent(!1);
|
|
4520
|
+
if (this.options.ecmaVersion >= 8 && !y && x.name === "async" && !this.canInsertSemicolon() && this.eat(h._function)) return this.overrideContext(lt.f_expr), this.parseFunction(this.startNodeAt(f, m), 0, !1, !0, r);
|
|
4521
4521
|
if (c && !this.canInsertSemicolon()) {
|
|
4522
|
-
if (this.eat(h.arrow)) return this.parseArrowExpression(this.startNodeAt(
|
|
4523
|
-
if (this.options.ecmaVersion >= 8 && x.name === "async" && this.type === h.name && !y && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return x = this.parseIdent(!1), !this.canInsertSemicolon() && this.eat(h.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAt(
|
|
4522
|
+
if (this.eat(h.arrow)) return this.parseArrowExpression(this.startNodeAt(f, m), [x], !1, r);
|
|
4523
|
+
if (this.options.ecmaVersion >= 8 && x.name === "async" && this.type === h.name && !y && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return x = this.parseIdent(!1), !this.canInsertSemicolon() && this.eat(h.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAt(f, m), [x], !0, r);
|
|
4524
4524
|
}
|
|
4525
4525
|
return x;
|
|
4526
4526
|
}
|
|
@@ -4533,8 +4533,8 @@ function rr(t) {
|
|
|
4533
4533
|
if (c === h._function) return this.next(), this.parseFunction(this.startNodeAtNode(n), void 0, !0, !0);
|
|
4534
4534
|
if (V(c)) {
|
|
4535
4535
|
if (this.lookaheadCharCode() === 61) {
|
|
4536
|
-
var
|
|
4537
|
-
return !this.canInsertSemicolon() && this.eat(h.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAtNode(n), [
|
|
4536
|
+
var f = this.parseIdent(!1);
|
|
4537
|
+
return !this.canInsertSemicolon() && this.eat(h.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAtNode(n), [f], !0);
|
|
4538
4538
|
}
|
|
4539
4539
|
return n;
|
|
4540
4540
|
}
|
|
@@ -4544,18 +4544,18 @@ function rr(t) {
|
|
|
4544
4544
|
this.unexpected();
|
|
4545
4545
|
}, p.parseIdentNode = function() {
|
|
4546
4546
|
var i = this.startNode();
|
|
4547
|
-
return
|
|
4547
|
+
return Qt(this.type) ? (i.name = this.value, i) : S.prototype.parseIdentNode.call(this);
|
|
4548
4548
|
}, p.parseVarStatement = function(i, r, n) {
|
|
4549
4549
|
n === void 0 && (n = !1);
|
|
4550
4550
|
var c = this.isAmbientContext;
|
|
4551
4551
|
this.next(), S.prototype.parseVar.call(this, i, !1, r, n || c), this.semicolon();
|
|
4552
|
-
var
|
|
4553
|
-
if (!c) return
|
|
4554
|
-
for (var m, y = Je(
|
|
4552
|
+
var f = this.finishNode(i, "VariableDeclaration");
|
|
4553
|
+
if (!c) return f;
|
|
4554
|
+
for (var m, y = Je(f.declarations); !(m = y()).done; ) {
|
|
4555
4555
|
var x = m.value, b = x.init;
|
|
4556
|
-
b && (r !== "const" || x.id.typeAnnotation ? this.raise(b.start, A.InitializerNotAllowedInAmbientContext) : b.type !== "StringLiteral" && b.type !== "BooleanLiteral" && b.type !== "NumericLiteral" && b.type !== "BigIntLiteral" && (b.type !== "TemplateLiteral" || b.expressions.length > 0) && !
|
|
4556
|
+
b && (r !== "const" || x.id.typeAnnotation ? this.raise(b.start, A.InitializerNotAllowedInAmbientContext) : b.type !== "StringLiteral" && b.type !== "BooleanLiteral" && b.type !== "NumericLiteral" && b.type !== "BigIntLiteral" && (b.type !== "TemplateLiteral" || b.expressions.length > 0) && !rr(b) && this.raise(b.start, A.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference));
|
|
4557
4557
|
}
|
|
4558
|
-
return
|
|
4558
|
+
return f;
|
|
4559
4559
|
}, p.parseStatement = function(i, r, n) {
|
|
4560
4560
|
if (this.match(I.at) && this.parseDecorators(!0), this.match(h._const) && this.isLookaheadContextual("enum")) {
|
|
4561
4561
|
var c = this.startNode();
|
|
@@ -4563,8 +4563,8 @@ function rr(t) {
|
|
|
4563
4563
|
}
|
|
4564
4564
|
if (this.ts_isContextual(I.enum)) return this.tsParseEnumDeclaration(this.startNode());
|
|
4565
4565
|
if (this.ts_isContextual(I.interface)) {
|
|
4566
|
-
var
|
|
4567
|
-
if (
|
|
4566
|
+
var f = this.tsParseInterfaceDeclaration(this.startNode());
|
|
4567
|
+
if (f) return f;
|
|
4568
4568
|
}
|
|
4569
4569
|
return S.prototype.parseStatement.call(this, i, r, n);
|
|
4570
4570
|
}, p.parseAccessModifier = function() {
|
|
@@ -4575,18 +4575,18 @@ function rr(t) {
|
|
|
4575
4575
|
return (r.type === "Identifier" ? this.tsParseExpressionStatement(i, r) : void 0) || S.prototype.parseExpressionStatement.call(this, i, r);
|
|
4576
4576
|
}, p.shouldParseExportStatement = function() {
|
|
4577
4577
|
return !!this.tsIsDeclarationStart() || !!this.match(I.at) || S.prototype.shouldParseExportStatement.call(this);
|
|
4578
|
-
}, p.parseConditional = function(i, r, n, c,
|
|
4578
|
+
}, p.parseConditional = function(i, r, n, c, f) {
|
|
4579
4579
|
if (this.eat(h.question)) {
|
|
4580
4580
|
var m = this.startNodeAt(r, n);
|
|
4581
4581
|
return m.test = i, m.consequent = this.parseMaybeAssign(), this.expect(h.colon), m.alternate = this.parseMaybeAssign(c), this.finishNode(m, "ConditionalExpression");
|
|
4582
4582
|
}
|
|
4583
4583
|
return i;
|
|
4584
4584
|
}, p.parseMaybeConditional = function(i, r) {
|
|
4585
|
-
var n = this, c = this.start,
|
|
4585
|
+
var n = this, c = this.start, f = this.startLoc, m = this.parseExprOps(i, r);
|
|
4586
4586
|
if (this.checkExpressionErrors(r)) return m;
|
|
4587
|
-
if (!this.maybeInArrowParameters || !this.match(h.question)) return this.parseConditional(m, c,
|
|
4587
|
+
if (!this.maybeInArrowParameters || !this.match(h.question)) return this.parseConditional(m, c, f, i, r);
|
|
4588
4588
|
var y = this.tryParse(function() {
|
|
4589
|
-
return n.parseConditional(m, c,
|
|
4589
|
+
return n.parseConditional(m, c, f, i, r);
|
|
4590
4590
|
});
|
|
4591
4591
|
return y.node ? (y.error && this.setLookaheadState(y.failState), y.node) : (y.error && this.setOptionalParametersError(r, y.error), m);
|
|
4592
4592
|
}, p.parseParenItem = function(i) {
|
|
@@ -4601,10 +4601,10 @@ function rr(t) {
|
|
|
4601
4601
|
if (!this.isAmbientContext && this.ts_isContextual(I.declare)) return this.tsInAmbientContext(function() {
|
|
4602
4602
|
return r.parseExportDeclaration(i);
|
|
4603
4603
|
});
|
|
4604
|
-
var n = this.start, c = this.startLoc,
|
|
4605
|
-
!
|
|
4604
|
+
var n = this.start, c = this.startLoc, f = this.eatContextual("declare");
|
|
4605
|
+
!f || !this.ts_isContextual(I.declare) && this.shouldParseExportStatement() || this.raise(this.start, A.ExpectedAmbientAfterExportDeclare);
|
|
4606
4606
|
var m = V(this.type) && this.tsTryParseExportDeclaration() || this.parseStatement(null);
|
|
4607
|
-
return m ? ((m.type === "TSInterfaceDeclaration" || m.type === "TSTypeAliasDeclaration" ||
|
|
4607
|
+
return m ? ((m.type === "TSInterfaceDeclaration" || m.type === "TSTypeAliasDeclaration" || f) && (i.exportKind = "type"), f && (this.resetStartLocation(m, n, c), m.declare = !0), m) : null;
|
|
4608
4608
|
}, p.parseClassId = function(i, r) {
|
|
4609
4609
|
if (r || !this.isContextual("implements")) {
|
|
4610
4610
|
S.prototype.parseClassId.call(this, i, r);
|
|
@@ -4623,8 +4623,8 @@ function rr(t) {
|
|
|
4623
4623
|
}
|
|
4624
4624
|
return S.prototype.parseClassField.call(this, i);
|
|
4625
4625
|
}, p.parseClassMethod = function(i, r, n, c) {
|
|
4626
|
-
var
|
|
4627
|
-
m ? (y && (i.typeParameters = y), i.accessibility && this.raise(i.start, A.PrivateMethodsHasAccessibility({ modifier: i.accessibility }))) : y &&
|
|
4626
|
+
var f = i.kind === "constructor", m = i.key.type === "PrivateIdentifier", y = this.tsTryParseTypeParameters();
|
|
4627
|
+
m ? (y && (i.typeParameters = y), i.accessibility && this.raise(i.start, A.PrivateMethodsHasAccessibility({ modifier: i.accessibility }))) : y && f && this.raise(y.start, A.ConstructorHasTypeParameters);
|
|
4628
4628
|
var x = i.declare, b = i.kind;
|
|
4629
4629
|
!(x !== void 0 && x) || b !== "get" && b !== "set" || this.raise(i.start, A.DeclareAccessor({ kind: b })), y && (i.typeParameters = y);
|
|
4630
4630
|
var T = i.key;
|
|
@@ -4636,25 +4636,25 @@ function rr(t) {
|
|
|
4636
4636
|
}, p.parseClassElement = function(i) {
|
|
4637
4637
|
var r = this;
|
|
4638
4638
|
if (this.eat(h.semi)) return null;
|
|
4639
|
-
var n, c = this.options.ecmaVersion,
|
|
4639
|
+
var n, c = this.options.ecmaVersion, f = this.startNode(), m = "", y = !1, x = !1, b = "method", T = ["declare", "private", "public", "protected", "accessor", "override", "abstract", "readonly", "static"], E = this.tsParseModifiers({ modified: f, allowedModifiers: T, disallowedModifiers: ["in", "out"], stopOnStartOfClassStaticBlock: !0, errorTemplate: A.InvalidModifierOnTypeParameterPositions });
|
|
4640
4640
|
n = !!E.static;
|
|
4641
4641
|
var L = function() {
|
|
4642
4642
|
if (!r.tsIsStartOfStaticBlocks()) {
|
|
4643
|
-
var k = r.tsTryParseIndexSignature(
|
|
4644
|
-
if (k) return
|
|
4645
|
-
if (!r.inAbstractClass &&
|
|
4643
|
+
var k = r.tsTryParseIndexSignature(f);
|
|
4644
|
+
if (k) return f.abstract && r.raise(f.start, A.IndexSignatureHasAbstract), f.accessibility && r.raise(f.start, A.IndexSignatureHasAccessibility({ modifier: f.accessibility })), f.declare && r.raise(f.start, A.IndexSignatureHasDeclare), f.override && r.raise(f.start, A.IndexSignatureHasOverride), k;
|
|
4645
|
+
if (!r.inAbstractClass && f.abstract && r.raise(f.start, A.NonAbstractClassHasAbstractMethod), f.override && i && r.raise(f.start, A.OverrideNotInSubClass), f.static = n, n && (r.isClassElementNameStart() || r.type === h.star || (m = "static")), !m && c >= 8 && r.eatContextual("async") && (!r.isClassElementNameStart() && r.type !== h.star || r.canInsertSemicolon() ? m = "async" : x = !0), !m && (c >= 9 || !x) && r.eat(h.star) && (y = !0), !m && !x && !y) {
|
|
4646
4646
|
var U = r.value;
|
|
4647
4647
|
(r.eatContextual("get") || r.eatContextual("set")) && (r.isClassElementNameStart() ? b = U : m = U);
|
|
4648
4648
|
}
|
|
4649
|
-
if (m ? (
|
|
4650
|
-
var
|
|
4651
|
-
|
|
4652
|
-
} else r.parseClassField(
|
|
4653
|
-
return
|
|
4649
|
+
if (m ? (f.computed = !1, f.key = r.startNodeAt(r.lastTokStart, r.lastTokStartLoc), f.key.name = m, r.finishNode(f.key, "Identifier")) : r.parseClassElementName(f), r.parsePostMemberNameModifiers(f), r.isClassMethod() || c < 13 || r.type === h.parenL || b !== "method" || y || x) {
|
|
4650
|
+
var B = !f.static && Ze(f, "constructor"), q = B && i;
|
|
4651
|
+
B && b !== "method" && r.raise(f.key.start, "Constructor can't have get/set modifier"), f.kind = B ? "constructor" : b, r.parseClassMethod(f, y, x, q);
|
|
4652
|
+
} else r.parseClassField(f);
|
|
4653
|
+
return f;
|
|
4654
4654
|
}
|
|
4655
|
-
if (r.next(), r.next(), r.tsHasSomeModifiers(
|
|
4655
|
+
if (r.next(), r.next(), r.tsHasSomeModifiers(f, T) && r.raise(r.start, A.StaticBlockCannotHaveModifier), c >= 13) return S.prototype.parseClassStaticBlock.call(r, f), f;
|
|
4656
4656
|
};
|
|
4657
|
-
return
|
|
4657
|
+
return f.declare ? this.tsInAmbientContext(L) : L(), f;
|
|
4658
4658
|
}, p.isClassElementNameStart = function() {
|
|
4659
4659
|
return !!this.tsIsIdentifier() || S.prototype.isClassElementNameStart.call(this);
|
|
4660
4660
|
}, p.parseClassSuper = function(i) {
|
|
@@ -4668,17 +4668,17 @@ function rr(t) {
|
|
|
4668
4668
|
n && (i.id.typeAnnotation = n, this.resetEndLocation(i.id));
|
|
4669
4669
|
}, p.parseArrowExpression = function(i, r, n, c) {
|
|
4670
4670
|
this.match(h.colon) && (i.returnType = this.tsParseTypeAnnotation());
|
|
4671
|
-
var
|
|
4671
|
+
var f = this.yieldPos, m = this.awaitPos, y = this.awaitIdentPos;
|
|
4672
4672
|
this.enterScope(16 | Se(n, !1)), this.initFunction(i);
|
|
4673
4673
|
var x = this.maybeInArrowParameters;
|
|
4674
|
-
return this.options.ecmaVersion >= 8 && (i.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.maybeInArrowParameters = !0, i.params = this.toAssignableList(r, !0), this.maybeInArrowParameters = !1, this.parseFunctionBody(i, !0, !1, c), this.yieldPos =
|
|
4674
|
+
return this.options.ecmaVersion >= 8 && (i.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.maybeInArrowParameters = !0, i.params = this.toAssignableList(r, !0), this.maybeInArrowParameters = !1, this.parseFunctionBody(i, !0, !1, c), this.yieldPos = f, this.awaitPos = m, this.awaitIdentPos = y, this.maybeInArrowParameters = x, this.finishNode(i, "ArrowFunctionExpression");
|
|
4675
4675
|
}, p.parseMaybeAssignOrigin = function(i, r, n) {
|
|
4676
4676
|
if (this.isContextual("yield")) {
|
|
4677
4677
|
if (this.inGenerator) return this.parseYield(i);
|
|
4678
4678
|
this.exprAllowed = !1;
|
|
4679
4679
|
}
|
|
4680
|
-
var c = !1,
|
|
4681
|
-
r ? (
|
|
4680
|
+
var c = !1, f = -1, m = -1, y = -1;
|
|
4681
|
+
r ? (f = r.parenthesizedAssign, m = r.trailingComma, y = r.doubleProto, r.parenthesizedAssign = r.trailingComma = -1) : (r = new Bt(), c = !0);
|
|
4682
4682
|
var x = this.start, b = this.startLoc;
|
|
4683
4683
|
(this.type === h.parenL || V(this.type)) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = i === "await");
|
|
4684
4684
|
var T = this.parseMaybeConditional(i, r);
|
|
@@ -4686,12 +4686,12 @@ function rr(t) {
|
|
|
4686
4686
|
var E = this.startNodeAt(x, b);
|
|
4687
4687
|
return E.operator = this.value, this.type === h.eq && (T = this.toAssignable(T, !0, r)), c || (r.parenthesizedAssign = r.trailingComma = r.doubleProto = -1), r.shorthandAssign >= T.start && (r.shorthandAssign = -1), this.type === h.eq ? this.checkLValPattern(T) : this.checkLValSimple(T), E.left = T, this.next(), E.right = this.parseMaybeAssign(i), y > -1 && (r.doubleProto = y), this.finishNode(E, "AssignmentExpression");
|
|
4688
4688
|
}
|
|
4689
|
-
return c && this.checkExpressionErrors(r, !0),
|
|
4689
|
+
return c && this.checkExpressionErrors(r, !0), f > -1 && (r.parenthesizedAssign = f), m > -1 && (r.trailingComma = m), T;
|
|
4690
4690
|
}, p.parseMaybeAssign = function(i, r, n) {
|
|
4691
|
-
var c,
|
|
4691
|
+
var c, f, m, y, x, b, T, E, L, k, U, B = this;
|
|
4692
4692
|
if (this.matchJsx("jsxTagStart") || this.tsMatchLeftRelational()) {
|
|
4693
4693
|
if (E = this.cloneCurLookaheadState(), !(L = this.tryParse(function() {
|
|
4694
|
-
return
|
|
4694
|
+
return B.parseMaybeAssignOrigin(i, r, n);
|
|
4695
4695
|
}, E)).error) return L.node;
|
|
4696
4696
|
var q = this.context, G = q[q.length - 1];
|
|
4697
4697
|
G === g.tokContexts.tc_oTag && q[q.length - 2] === g.tokContexts.tc_expr ? (q.pop(), q.pop()) : G !== g.tokContexts.tc_oTag && G !== g.tokContexts.tc_expr || q.pop();
|
|
@@ -4700,30 +4700,30 @@ function rr(t) {
|
|
|
4700
4700
|
E && !this.compareLookaheadState(E, this.getCurLookaheadState()) || (E = this.cloneCurLookaheadState());
|
|
4701
4701
|
var it = this.tryParse(function(Pt) {
|
|
4702
4702
|
var Vt, Ft;
|
|
4703
|
-
U =
|
|
4704
|
-
var Ct =
|
|
4705
|
-
return (Ct.type !== "ArrowFunctionExpression" || (Vt = Ct.extra) != null && Vt.parenthesized) && Pt(), ((Ft = U) == null ? void 0 : Ft.params.length) !== 0 &&
|
|
4703
|
+
U = B.tsParseTypeParameters();
|
|
4704
|
+
var Ct = B.parseMaybeAssignOrigin(i, r, n);
|
|
4705
|
+
return (Ct.type !== "ArrowFunctionExpression" || (Vt = Ct.extra) != null && Vt.parenthesized) && Pt(), ((Ft = U) == null ? void 0 : Ft.params.length) !== 0 && B.resetStartLocationFromNode(Ct, U), Ct.typeParameters = U, Ct;
|
|
4706
4706
|
}, E);
|
|
4707
4707
|
if (!it.error && !it.aborted) return U && this.reportReservedArrowTypeParam(U), it.node;
|
|
4708
4708
|
if (!L && (ti(!0), !(k = this.tryParse(function() {
|
|
4709
|
-
return
|
|
4709
|
+
return B.parseMaybeAssignOrigin(i, r, n);
|
|
4710
4710
|
}, E)).error)) return k.node;
|
|
4711
|
-
if ((
|
|
4711
|
+
if ((f = L) != null && f.node) return this.setLookaheadState(L.failState), L.node;
|
|
4712
4712
|
if (it.node) return this.setLookaheadState(it.failState), U && this.reportReservedArrowTypeParam(U), it.node;
|
|
4713
4713
|
if ((m = k) != null && m.node) return this.setLookaheadState(k.failState), k.node;
|
|
4714
4714
|
throw (y = L) != null && y.thrown ? L.error : it.thrown ? it.error : (x = k) != null && x.thrown ? k.error : ((b = L) == null ? void 0 : b.error) || it.error || ((T = k) == null ? void 0 : T.error);
|
|
4715
4715
|
}, p.parseAssignableListItem = function(i) {
|
|
4716
4716
|
for (var r = []; this.match(I.at); ) r.push(this.parseDecorator());
|
|
4717
|
-
var n, c = this.start,
|
|
4717
|
+
var n, c = this.start, f = this.startLoc, m = !1, y = !1;
|
|
4718
4718
|
if (i !== void 0) {
|
|
4719
4719
|
var x = {};
|
|
4720
|
-
this.tsParseModifiers({ modified: x, allowedModifiers: ["public", "private", "protected", "override", "readonly"] }), n = x.accessibility, y = x.override, m = x.readonly, i === !1 && (n || m || y) && this.raise(
|
|
4720
|
+
this.tsParseModifiers({ modified: x, allowedModifiers: ["public", "private", "protected", "override", "readonly"] }), n = x.accessibility, y = x.override, m = x.readonly, i === !1 && (n || m || y) && this.raise(f.start, A.UnexpectedParameterModifier);
|
|
4721
4721
|
}
|
|
4722
|
-
var b = this.parseMaybeDefault(c,
|
|
4722
|
+
var b = this.parseMaybeDefault(c, f);
|
|
4723
4723
|
this.parseBindingListItem(b);
|
|
4724
4724
|
var T = this.parseMaybeDefault(b.start, b.loc, b);
|
|
4725
4725
|
if (r.length && (T.decorators = r), n || m || y) {
|
|
4726
|
-
var E = this.startNodeAt(c,
|
|
4726
|
+
var E = this.startNodeAt(c, f);
|
|
4727
4727
|
return n && (E.accessibility = n), m && (E.readonly = m), y && (E.override = y), T.type !== "Identifier" && T.type !== "AssignmentPattern" && this.raise(E.start, A.UnsupportedParameterPropertyKind), E.parameter = T, this.finishNode(E, "TSParameterProperty");
|
|
4728
4728
|
}
|
|
4729
4729
|
return T;
|
|
@@ -4747,8 +4747,8 @@ function rr(t) {
|
|
|
4747
4747
|
return !0;
|
|
4748
4748
|
case "ObjectExpression":
|
|
4749
4749
|
var c = i.properties.length - 1;
|
|
4750
|
-
return i.properties.every(function(
|
|
4751
|
-
return
|
|
4750
|
+
return i.properties.every(function(f, m) {
|
|
4751
|
+
return f.type !== "ObjectMethod" && (m === c || f.type !== "SpreadElement") && n.isAssignable(f);
|
|
4752
4752
|
});
|
|
4753
4753
|
case "Property":
|
|
4754
4754
|
case "ObjectProperty":
|
|
@@ -4756,8 +4756,8 @@ function rr(t) {
|
|
|
4756
4756
|
case "SpreadElement":
|
|
4757
4757
|
return this.isAssignable(i.argument);
|
|
4758
4758
|
case "ArrayExpression":
|
|
4759
|
-
return i.elements.every(function(
|
|
4760
|
-
return
|
|
4759
|
+
return i.elements.every(function(f) {
|
|
4760
|
+
return f === null || n.isAssignable(f);
|
|
4761
4761
|
});
|
|
4762
4762
|
case "AssignmentExpression":
|
|
4763
4763
|
return i.operator === "=";
|
|
@@ -4770,7 +4770,7 @@ function rr(t) {
|
|
|
4770
4770
|
return !1;
|
|
4771
4771
|
}
|
|
4772
4772
|
}, p.toAssignable = function(i, r, n) {
|
|
4773
|
-
switch (r === void 0 && (r = !1), n === void 0 && (n = new
|
|
4773
|
+
switch (r === void 0 && (r = !1), n === void 0 && (n = new Bt()), i.type) {
|
|
4774
4774
|
case "ParenthesizedExpression":
|
|
4775
4775
|
return this.toAssignableParenthesizedExpression(i, r, n);
|
|
4776
4776
|
case "TSAsExpression":
|
|
@@ -4813,13 +4813,13 @@ function rr(t) {
|
|
|
4813
4813
|
return this.type === h._this ? this.parseIdent(!0) : S.prototype.parseBindingAtom.call(this);
|
|
4814
4814
|
}, p.shouldParseArrow = function(i) {
|
|
4815
4815
|
var r, n = this;
|
|
4816
|
-
if (r = this.match(h.colon) ? i.every(function(
|
|
4817
|
-
return n.isAssignable(
|
|
4816
|
+
if (r = this.match(h.colon) ? i.every(function(f) {
|
|
4817
|
+
return n.isAssignable(f, !0);
|
|
4818
4818
|
}) : !this.canInsertSemicolon()) {
|
|
4819
4819
|
if (this.match(h.colon)) {
|
|
4820
|
-
var c = this.tryParse(function(
|
|
4820
|
+
var c = this.tryParse(function(f) {
|
|
4821
4821
|
var m = n.tsParseTypeOrTypePredicateAnnotation(h.colon);
|
|
4822
|
-
return !n.canInsertSemicolon() && n.match(h.arrow) ||
|
|
4822
|
+
return !n.canInsertSemicolon() && n.match(h.arrow) || f(), m;
|
|
4823
4823
|
});
|
|
4824
4824
|
if (c.aborted) return this.shouldParseArrowReturnType = void 0, !1;
|
|
4825
4825
|
c.thrown || (c.error && this.setLookaheadState(c.failState), this.shouldParseArrowReturnType = c.node);
|
|
@@ -4828,14 +4828,14 @@ function rr(t) {
|
|
|
4828
4828
|
}
|
|
4829
4829
|
return this.shouldParseArrowReturnType = void 0, r;
|
|
4830
4830
|
}, p.parseParenArrowList = function(i, r, n, c) {
|
|
4831
|
-
var
|
|
4832
|
-
return
|
|
4831
|
+
var f = this.startNodeAt(i, r);
|
|
4832
|
+
return f.returnType = this.shouldParseArrowReturnType, this.shouldParseArrowReturnType = void 0, this.parseArrowExpression(f, n, !1, c);
|
|
4833
4833
|
}, p.parseParenAndDistinguishExpression = function(i, r) {
|
|
4834
|
-
var n, c = this.start,
|
|
4834
|
+
var n, c = this.start, f = this.startLoc, m = this.options.ecmaVersion >= 8;
|
|
4835
4835
|
if (this.options.ecmaVersion >= 6) {
|
|
4836
4836
|
var y = this.maybeInArrowParameters;
|
|
4837
4837
|
this.maybeInArrowParameters = !0, this.next();
|
|
4838
|
-
var x, b = this.start, T = this.startLoc, E = [], L = !0, k = !1, U = new
|
|
4838
|
+
var x, b = this.start, T = this.startLoc, E = [], L = !0, k = !1, U = new Bt(), B = this.yieldPos, q = this.awaitPos;
|
|
4839
4839
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== h.parenR; ) {
|
|
4840
4840
|
if (L ? L = !1 : this.expect(h.comma), m && this.afterTrailingComma(h.parenR, !0)) {
|
|
4841
4841
|
k = !0;
|
|
@@ -4848,17 +4848,17 @@ function rr(t) {
|
|
|
4848
4848
|
E.push(this.parseMaybeAssign(r, U, this.parseParenItem));
|
|
4849
4849
|
}
|
|
4850
4850
|
var G = this.lastTokEnd, it = this.lastTokEndLoc;
|
|
4851
|
-
if (this.expect(h.parenR), this.maybeInArrowParameters = y, i && this.shouldParseArrow(E) && this.eat(h.arrow)) return this.checkPatternErrors(U, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos =
|
|
4852
|
-
E.length && !k || this.unexpected(this.lastTokStart), x && this.unexpected(x), this.checkExpressionErrors(U, !0), this.yieldPos =
|
|
4851
|
+
if (this.expect(h.parenR), this.maybeInArrowParameters = y, i && this.shouldParseArrow(E) && this.eat(h.arrow)) return this.checkPatternErrors(U, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = B, this.awaitPos = q, this.parseParenArrowList(c, f, E, r);
|
|
4852
|
+
E.length && !k || this.unexpected(this.lastTokStart), x && this.unexpected(x), this.checkExpressionErrors(U, !0), this.yieldPos = B || this.yieldPos, this.awaitPos = q || this.awaitPos, E.length > 1 ? ((n = this.startNodeAt(b, T)).expressions = E, this.finishNodeAt(n, "SequenceExpression", G, it)) : n = E[0];
|
|
4853
4853
|
} else n = this.parseParenExpression();
|
|
4854
4854
|
if (this.options.preserveParens) {
|
|
4855
|
-
var Pt = this.startNodeAt(c,
|
|
4855
|
+
var Pt = this.startNodeAt(c, f);
|
|
4856
4856
|
return Pt.expression = n, this.finishNode(Pt, "ParenthesizedExpression");
|
|
4857
4857
|
}
|
|
4858
4858
|
return n;
|
|
4859
4859
|
}, p.parseTaggedTemplateExpression = function(i, r, n, c) {
|
|
4860
|
-
var
|
|
4861
|
-
return
|
|
4860
|
+
var f = this.startNodeAt(r, n);
|
|
4861
|
+
return f.tag = i, f.quasi = this.parseTemplate({ isTagged: !0 }), c && this.raise(r, "Tagged Template Literals are not allowed in optionalChain."), this.finishNode(f, "TaggedTemplateExpression");
|
|
4862
4862
|
}, p.shouldParseAsyncArrow = function() {
|
|
4863
4863
|
var i = this;
|
|
4864
4864
|
if (!this.match(h.colon)) return !this.canInsertSemicolon() && this.eat(h.arrow);
|
|
@@ -4868,17 +4868,17 @@ function rr(t) {
|
|
|
4868
4868
|
});
|
|
4869
4869
|
return r.aborted ? (this.shouldParseAsyncArrowReturnType = void 0, !1) : r.thrown ? void 0 : (r.error && this.setLookaheadState(r.failState), this.shouldParseAsyncArrowReturnType = r.node, !this.canInsertSemicolon() && this.eat(h.arrow));
|
|
4870
4870
|
}, p.parseSubscriptAsyncArrow = function(i, r, n, c) {
|
|
4871
|
-
var
|
|
4872
|
-
return
|
|
4871
|
+
var f = this.startNodeAt(i, r);
|
|
4872
|
+
return f.returnType = this.shouldParseAsyncArrowReturnType, this.shouldParseAsyncArrowReturnType = void 0, this.parseArrowExpression(f, n, !0, c);
|
|
4873
4873
|
}, p.parseExprList = function(i, r, n, c) {
|
|
4874
|
-
for (var
|
|
4874
|
+
for (var f = [], m = !0; !this.eat(i); ) {
|
|
4875
4875
|
if (m) m = !1;
|
|
4876
4876
|
else if (this.expect(h.comma), r && this.afterTrailingComma(i)) break;
|
|
4877
4877
|
var y = void 0;
|
|
4878
|
-
n && this.type === h.comma ? y = null : this.type === h.ellipsis ? (y = this.parseSpread(c), c && this.type === h.comma && c.trailingComma < 0 && (c.trailingComma = this.start)) : y = this.parseMaybeAssign(!1, c, this.parseParenItem),
|
|
4878
|
+
n && this.type === h.comma ? y = null : this.type === h.ellipsis ? (y = this.parseSpread(c), c && this.type === h.comma && c.trailingComma < 0 && (c.trailingComma = this.start)) : y = this.parseMaybeAssign(!1, c, this.parseParenItem), f.push(y);
|
|
4879
4879
|
}
|
|
4880
|
-
return
|
|
4881
|
-
}, p.parseSubscript = function(i, r, n, c,
|
|
4880
|
+
return f;
|
|
4881
|
+
}, p.parseSubscript = function(i, r, n, c, f, m, y) {
|
|
4882
4882
|
var x = this, b = m;
|
|
4883
4883
|
if (!this.hasPrecedingLineBreak() && this.value === "!" && this.match(h.prefix)) {
|
|
4884
4884
|
this.exprAllowed = !1, this.next();
|
|
@@ -4893,49 +4893,49 @@ function rr(t) {
|
|
|
4893
4893
|
if (this.tsMatchLeftRelational() || this.match(h.bitShift)) {
|
|
4894
4894
|
var L, k = this.tsTryParseAndCatch(function() {
|
|
4895
4895
|
if (!c && x.atPossibleAsyncArrow(i)) {
|
|
4896
|
-
var
|
|
4897
|
-
if (
|
|
4896
|
+
var Be = x.tsTryParseGenericAsyncArrowFunction(r, n, y);
|
|
4897
|
+
if (Be) return i = Be;
|
|
4898
4898
|
}
|
|
4899
|
-
var
|
|
4900
|
-
if (!
|
|
4899
|
+
var Yt = x.tsParseTypeArgumentsInExpression();
|
|
4900
|
+
if (!Yt) return i;
|
|
4901
4901
|
if (E && !x.match(h.parenL)) return L = x.curPosition(), i;
|
|
4902
|
-
if (
|
|
4902
|
+
if (Gi(x.type) || x.type === h.backQuote) {
|
|
4903
4903
|
var Ue = x.parseTaggedTemplateExpression(i, r, n, b);
|
|
4904
|
-
return Ue.typeParameters =
|
|
4904
|
+
return Ue.typeParameters = Yt, Ue;
|
|
4905
4905
|
}
|
|
4906
4906
|
if (!c && x.eat(h.parenL)) {
|
|
4907
|
-
var qe = new
|
|
4908
|
-
return Nt.callee = i, Nt.arguments = x.parseExprList(h.parenR, x.options.ecmaVersion >= 8, !1, qe), x.tsCheckForInvalidTypeCasts(Nt.arguments), Nt.typeParameters =
|
|
4907
|
+
var qe = new Bt(), Nt = x.startNodeAt(r, n);
|
|
4908
|
+
return Nt.callee = i, Nt.arguments = x.parseExprList(h.parenR, x.options.ecmaVersion >= 8, !1, qe), x.tsCheckForInvalidTypeCasts(Nt.arguments), Nt.typeParameters = Yt, b && (Nt.optional = E), x.checkExpressionErrors(qe, !0), i = x.finishNode(Nt, "CallExpression");
|
|
4909
4909
|
}
|
|
4910
4910
|
var me = x.type;
|
|
4911
4911
|
if (!(x.tsMatchRightRelational() || me === h.bitShift || me !== h.parenL && (He = me, !!He.startsExpr) && !x.hasPrecedingLineBreak())) {
|
|
4912
4912
|
var He, ye = x.startNodeAt(r, n);
|
|
4913
|
-
return ye.expression = i, ye.typeParameters =
|
|
4913
|
+
return ye.expression = i, ye.typeParameters = Yt, x.finishNode(ye, "TSInstantiationExpression");
|
|
4914
4914
|
}
|
|
4915
4915
|
});
|
|
4916
4916
|
if (L && this.unexpected(L), k) return k.type === "TSInstantiationExpression" && (this.match(h.dot) || this.match(h.questionDot) && this.lookaheadCharCode() !== 40) && this.raise(this.start, A.InvalidPropertyAccessAfterInstantiationExpression), i = k;
|
|
4917
4917
|
}
|
|
4918
|
-
var U = this.options.ecmaVersion >= 11,
|
|
4919
|
-
c &&
|
|
4918
|
+
var U = this.options.ecmaVersion >= 11, B = U && this.eat(h.questionDot);
|
|
4919
|
+
c && B && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
4920
4920
|
var q = this.eat(h.bracketL);
|
|
4921
|
-
if (q ||
|
|
4921
|
+
if (q || B && this.type !== h.parenL && this.type !== h.backQuote || this.eat(h.dot)) {
|
|
4922
4922
|
var G = this.startNodeAt(r, n);
|
|
4923
|
-
G.object = i, q ? (G.property = this.parseExpression(), this.expect(h.bracketR)) : G.property = this.type === h.privateId && i.type !== "Super" ? this.parsePrivateIdent() : this.parseIdent(this.options.allowReserved !== "never"), G.computed = !!q, U && (G.optional =
|
|
4923
|
+
G.object = i, q ? (G.property = this.parseExpression(), this.expect(h.bracketR)) : G.property = this.type === h.privateId && i.type !== "Super" ? this.parsePrivateIdent() : this.parseIdent(this.options.allowReserved !== "never"), G.computed = !!q, U && (G.optional = B), i = this.finishNode(G, "MemberExpression");
|
|
4924
4924
|
} else if (!c && this.eat(h.parenL)) {
|
|
4925
4925
|
var it = this.maybeInArrowParameters;
|
|
4926
4926
|
this.maybeInArrowParameters = !0;
|
|
4927
|
-
var Pt = new
|
|
4927
|
+
var Pt = new Bt(), Vt = this.yieldPos, Ft = this.awaitPos, Ct = this.awaitIdentPos;
|
|
4928
4928
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
4929
|
-
var
|
|
4930
|
-
if (
|
|
4929
|
+
var je = this.parseExprList(h.parenR, this.options.ecmaVersion >= 8, !1, Pt);
|
|
4930
|
+
if (f && !B && this.shouldParseAsyncArrow()) this.checkPatternErrors(Pt, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = Vt, this.awaitPos = Ft, this.awaitIdentPos = Ct, i = this.parseSubscriptAsyncArrow(r, n, je, y);
|
|
4931
4931
|
else {
|
|
4932
4932
|
this.checkExpressionErrors(Pt, !0), this.yieldPos = Vt || this.yieldPos, this.awaitPos = Ft || this.awaitPos, this.awaitIdentPos = Ct || this.awaitIdentPos;
|
|
4933
|
-
var
|
|
4934
|
-
|
|
4933
|
+
var Jt = this.startNodeAt(r, n);
|
|
4934
|
+
Jt.callee = i, Jt.arguments = je, U && (Jt.optional = B), i = this.finishNode(Jt, "CallExpression");
|
|
4935
4935
|
}
|
|
4936
4936
|
this.maybeInArrowParameters = it;
|
|
4937
4937
|
} else if (this.type === h.backQuote) {
|
|
4938
|
-
(
|
|
4938
|
+
(B || b) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
4939
4939
|
var de = this.startNodeAt(r, n);
|
|
4940
4940
|
de.tag = i, de.quasi = this.parseTemplate({ isTagged: !0 }), i = this.finishNode(de, "TaggedTemplateExpression");
|
|
4941
4941
|
}
|
|
@@ -4964,13 +4964,13 @@ function rr(t) {
|
|
|
4964
4964
|
this.next(), this.takeDecorators(i);
|
|
4965
4965
|
var c = this.strict;
|
|
4966
4966
|
this.strict = !0, this.parseClassId(i, r), this.parseClassSuper(i);
|
|
4967
|
-
var
|
|
4967
|
+
var f = this.enterClassBody(), m = this.startNode(), y = !1;
|
|
4968
4968
|
m.body = [];
|
|
4969
4969
|
var x = [];
|
|
4970
4970
|
for (this.expect(h.braceL); this.type !== h.braceR; ) if (this.match(I.at)) x.push(this.parseDecorator());
|
|
4971
4971
|
else {
|
|
4972
4972
|
var b = this.parseClassElement(i.superClass !== null);
|
|
4973
|
-
x.length && (b.decorators = x, this.resetStartLocationFromNode(b, x[0]), x = []), b && (m.body.push(b), b.type === "MethodDefinition" && b.kind === "constructor" && b.value.type === "FunctionExpression" ? (y && this.raiseRecoverable(b.start, "Duplicate constructor in the same class"), y = !0, b.decorators && b.decorators.length > 0 && this.raise(b.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")) : b.key && b.key.type === "PrivateIdentifier" &&
|
|
4973
|
+
x.length && (b.decorators = x, this.resetStartLocationFromNode(b, x[0]), x = []), b && (m.body.push(b), b.type === "MethodDefinition" && b.kind === "constructor" && b.value.type === "FunctionExpression" ? (y && this.raiseRecoverable(b.start, "Duplicate constructor in the same class"), y = !0, b.decorators && b.decorators.length > 0 && this.raise(b.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")) : b.key && b.key.type === "PrivateIdentifier" && Ys(f, b) && this.raiseRecoverable(b.key.start, "Identifier '#" + b.key.name + "' has already been declared"));
|
|
4974
4974
|
}
|
|
4975
4975
|
return this.strict = c, this.next(), x.length && this.raise(this.start, "Decorators must be attached to a class element."), i.body = this.finishNode(m, "ClassBody"), this.exitClassBody(), this.finishNode(i, r ? "ClassDeclaration" : "ClassExpression");
|
|
4976
4976
|
} finally {
|
|
@@ -4979,19 +4979,19 @@ function rr(t) {
|
|
|
4979
4979
|
}, p.parseClassFunctionParams = function() {
|
|
4980
4980
|
var i = this.tsTryParseTypeParameters(this.tsParseConstModifier), r = this.parseBindingList(h.parenR, !1, this.options.ecmaVersion >= 8, !0);
|
|
4981
4981
|
return i && (r.typeParameters = i), r;
|
|
4982
|
-
}, p.parseMethod = function(i, r, n, c,
|
|
4982
|
+
}, p.parseMethod = function(i, r, n, c, f) {
|
|
4983
4983
|
var m = this.startNode(), y = this.yieldPos, x = this.awaitPos, b = this.awaitIdentPos;
|
|
4984
|
-
if (this.initFunction(m), this.options.ecmaVersion >= 6 && (m.generator = i), this.options.ecmaVersion >= 8 && (m.async = !!r), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | Se(r, m.generator) | (n ? 128 : 0)), this.expect(h.parenL), m.params = this.parseClassFunctionParams(), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(m, !1, !0, !1, { isClassMethod: c }), this.yieldPos = y, this.awaitPos = x, this.awaitIdentPos = b,
|
|
4985
|
-
var T =
|
|
4986
|
-
this.raise(
|
|
4984
|
+
if (this.initFunction(m), this.options.ecmaVersion >= 6 && (m.generator = i), this.options.ecmaVersion >= 8 && (m.async = !!r), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | Se(r, m.generator) | (n ? 128 : 0)), this.expect(h.parenL), m.params = this.parseClassFunctionParams(), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(m, !1, !0, !1, { isClassMethod: c }), this.yieldPos = y, this.awaitPos = x, this.awaitIdentPos = b, f && f.abstract && m.body) {
|
|
4985
|
+
var T = f.key;
|
|
4986
|
+
this.raise(f.start, A.AbstractMethodHasImplementation({ methodName: T.type !== "Identifier" || f.computed ? "[" + this.input.slice(T.start, T.end) + "]" : T.name }));
|
|
4987
4987
|
}
|
|
4988
4988
|
return this.finishNode(m, "FunctionExpression");
|
|
4989
|
-
},
|
|
4989
|
+
}, tt.parse = function(i, r) {
|
|
4990
4990
|
if (r.locations === !1) throw new Error("You have to enable options.locations while using acorn-typescript");
|
|
4991
4991
|
r.locations = !0;
|
|
4992
4992
|
var n = new this(r, i);
|
|
4993
4993
|
return a && (n.isAmbientContext = !0), n.parse();
|
|
4994
|
-
},
|
|
4994
|
+
}, tt.parseExpressionAt = function(i, r, n) {
|
|
4995
4995
|
if (n.locations === !1) throw new Error("You have to enable options.locations while using acorn-typescript");
|
|
4996
4996
|
n.locations = !0;
|
|
4997
4997
|
var c = new this(n, i, r);
|
|
@@ -5012,15 +5012,15 @@ function rr(t) {
|
|
|
5012
5012
|
var c = S.prototype.parseExportSpecifier.call(this, i);
|
|
5013
5013
|
return c.exportKind = "value", c;
|
|
5014
5014
|
}, p.parseTypeOnlyImportExportSpecifier = function(i, r, n) {
|
|
5015
|
-
var c,
|
|
5015
|
+
var c, f = r ? "imported" : "local", m = r ? "local" : "exported", y = i[f], x = !1, b = !0, T = y.start;
|
|
5016
5016
|
if (this.isContextual("as")) {
|
|
5017
5017
|
var E = this.parseIdent();
|
|
5018
5018
|
if (this.isContextual("as")) {
|
|
5019
5019
|
var L = this.parseIdent();
|
|
5020
|
-
|
|
5021
|
-
} else
|
|
5022
|
-
} else
|
|
5023
|
-
x && n && this.raise(T, r ? A.TypeModifierIsUsedInTypeImports : A.TypeModifierIsUsedInTypeExports), i[
|
|
5020
|
+
Qt(this.type) ? (x = !0, y = E, c = r ? this.parseIdent() : this.parseModuleExportName(), b = !1) : (c = L, b = !1);
|
|
5021
|
+
} else Qt(this.type) ? (b = !1, c = r ? this.parseIdent() : this.parseModuleExportName()) : (x = !0, y = E);
|
|
5022
|
+
} else Qt(this.type) && (x = !0, r ? (y = S.prototype.parseIdent.call(this, !0), this.isContextual("as") || this.checkUnreserved(y)) : y = this.parseModuleExportName());
|
|
5023
|
+
x && n && this.raise(T, r ? A.TypeModifierIsUsedInTypeImports : A.TypeModifierIsUsedInTypeExports), i[f] = y, i[m] = c, i[r ? "importKind" : "exportKind"] = x ? "type" : "value", b && this.eatContextual("as") && (i[m] = r ? this.parseIdent() : this.parseModuleExportName()), i[m] || (i[m] = this.copyNode(i[f])), r && this.checkLValSimple(i[m], 2);
|
|
5024
5024
|
}, p.raiseCommonCheck = function(i, r, n) {
|
|
5025
5025
|
return r === "Comma is not permitted after the rest element" ? this.isAmbientContext && this.match(h.comma) && this.lookaheadCharCode() === 41 ? void this.next() : S.prototype.raise.call(this, i, r) : n ? S.prototype.raiseRecoverable.call(this, i, r) : S.prototype.raise.call(this, i, r);
|
|
5026
5026
|
}, p.raiseRecoverable = function(i, r) {
|
|
@@ -5031,27 +5031,27 @@ function rr(t) {
|
|
|
5031
5031
|
var r = this.type;
|
|
5032
5032
|
if (r == h.braceL) {
|
|
5033
5033
|
var n = this.curContext();
|
|
5034
|
-
n ==
|
|
5034
|
+
n == Z.tc_oTag ? this.context.push(lt.b_expr) : n == Z.tc_expr ? this.context.push(lt.b_tmpl) : S.prototype.updateContext.call(this, i), this.exprAllowed = !0;
|
|
5035
5035
|
} else {
|
|
5036
5036
|
if (r !== h.slash || i !== I.jsxTagStart) return S.prototype.updateContext.call(this, i);
|
|
5037
|
-
this.context.length -= 2, this.context.push(
|
|
5037
|
+
this.context.length -= 2, this.context.push(Z.tc_cTag), this.exprAllowed = !1;
|
|
5038
5038
|
}
|
|
5039
5039
|
}, p.jsx_parseOpeningElementAt = function(i, r) {
|
|
5040
|
-
var n = this, c = this.startNodeAt(i, r),
|
|
5041
|
-
if (
|
|
5040
|
+
var n = this, c = this.startNodeAt(i, r), f = this.jsx_parseElementName();
|
|
5041
|
+
if (f && (c.name = f), this.match(h.relational) || this.match(h.bitShift)) {
|
|
5042
5042
|
var m = this.tsTryParseAndCatch(function() {
|
|
5043
5043
|
return n.tsParseTypeArgumentsInExpression();
|
|
5044
5044
|
});
|
|
5045
5045
|
m && (c.typeParameters = m);
|
|
5046
5046
|
}
|
|
5047
5047
|
for (c.attributes = []; this.type !== h.slash && this.type !== I.jsxTagEnd; ) c.attributes.push(this.jsx_parseAttribute());
|
|
5048
|
-
return c.selfClosing = this.eat(h.slash), this.expect(I.jsxTagEnd), this.finishNode(c,
|
|
5048
|
+
return c.selfClosing = this.eat(h.slash), this.expect(I.jsxTagEnd), this.finishNode(c, f ? "JSXOpeningElement" : "JSXOpeningFragment");
|
|
5049
5049
|
}, p.enterScope = function(i) {
|
|
5050
|
-
i ===
|
|
5050
|
+
i === jt && this.importsStack.push([]), S.prototype.enterScope.call(this, i);
|
|
5051
5051
|
var r = S.prototype.currentScope.call(this);
|
|
5052
5052
|
r.types = [], r.enums = [], r.constEnums = [], r.classes = [], r.exportOnlyBindings = [];
|
|
5053
5053
|
}, p.exitScope = function() {
|
|
5054
|
-
S.prototype.currentScope.call(this).flags ===
|
|
5054
|
+
S.prototype.currentScope.call(this).flags === jt && this.importsStack.pop(), S.prototype.exitScope.call(this);
|
|
5055
5055
|
}, p.hasImport = function(i, r) {
|
|
5056
5056
|
var n = this.importsStack.length;
|
|
5057
5057
|
if (this.importsStack[n - 1].indexOf(i) > -1) return !0;
|
|
@@ -5079,17 +5079,28 @@ function rr(t) {
|
|
|
5079
5079
|
}
|
|
5080
5080
|
S.prototype.checkLocalExport.call(this, i);
|
|
5081
5081
|
}
|
|
5082
|
-
}, z =
|
|
5082
|
+
}, z = tt, D = [{ key: "acornTypeScript", get: function() {
|
|
5083
5083
|
return g;
|
|
5084
5084
|
} }], ($ = [{ key: "acornTypeScript", get: function() {
|
|
5085
5085
|
return g;
|
|
5086
|
-
} }]) && Xe(z.prototype, $), D && Xe(z, D), Object.defineProperty(z, "prototype", { writable: !1 }),
|
|
5086
|
+
} }]) && Xe(z.prototype, $), D && Xe(z, D), Object.defineProperty(z, "prototype", { writable: !1 }), tt;
|
|
5087
5087
|
})(d);
|
|
5088
|
-
return
|
|
5088
|
+
return Xi;
|
|
5089
5089
|
};
|
|
5090
5090
|
}
|
|
5091
|
-
const
|
|
5092
|
-
|
|
5091
|
+
const nr = [
|
|
5092
|
+
{ idPrefix: "datapos-app-nuxt", typeId: "app", isPublish: !1, uploadGroupName: void 0 },
|
|
5093
|
+
{ idPrefix: "datapos-api", typeId: "api", isPublish: !1, uploadGroupName: void 0 },
|
|
5094
|
+
{ idPrefix: "datapos-connector", typeId: "connector", isPublish: !0, uploadGroupName: "connectors" },
|
|
5095
|
+
{ idPrefix: "datapos-context", typeId: "context", isPublish: !0, uploadGroupName: "contexts" },
|
|
5096
|
+
{ idPrefix: "datapos-development", typeId: "development", isPublish: !0, uploadGroupName: void 0 },
|
|
5097
|
+
{ idPrefix: "datapos-engine", typeId: "engine", isPublish: !1, uploadGroupName: "engine" },
|
|
5098
|
+
{ idPrefix: "datapos-presenter", typeId: "presenter", isPublish: !0, uploadGroupName: "presenters" },
|
|
5099
|
+
{ idPrefix: "datapos-resources", typeId: "resources", isPublish: !1, uploadGroupName: void 0 },
|
|
5100
|
+
{ idPrefix: "datapos-shared", typeId: "shared", isPublish: !0, uploadGroupName: void 0 },
|
|
5101
|
+
{ idPrefix: "datapos-tool", typeId: "tool", isPublish: !0, uploadGroupName: "tools" }
|
|
5102
|
+
], or = ss(rs);
|
|
5103
|
+
async function hr(t) {
|
|
5093
5104
|
let e;
|
|
5094
5105
|
try {
|
|
5095
5106
|
e = await at.readdir(t, { withFileTypes: !0 });
|
|
@@ -5109,28 +5120,33 @@ async function nr(t) {
|
|
|
5109
5120
|
);
|
|
5110
5121
|
}
|
|
5111
5122
|
function De(t) {
|
|
5112
|
-
const s = H.extend(
|
|
5123
|
+
const s = H.extend(ar()).parse(t, {
|
|
5113
5124
|
ecmaVersion: "latest",
|
|
5114
5125
|
sourceType: "module",
|
|
5115
5126
|
locations: !0
|
|
5116
5127
|
}), a = [];
|
|
5117
5128
|
return Ae(s, (o) => {
|
|
5118
5129
|
if (o.type !== "MethodDefinition") return;
|
|
5119
|
-
const
|
|
5130
|
+
const l = o, d = l.key;
|
|
5120
5131
|
if (d.type !== "Identifier") return;
|
|
5121
5132
|
const v = d.name;
|
|
5122
|
-
v && v !== "constructor" &&
|
|
5133
|
+
v && v !== "constructor" && l.accessibility !== "private" && a.push(v);
|
|
5123
5134
|
}), a;
|
|
5124
5135
|
}
|
|
5125
5136
|
async function ct(t, e, s = [], a) {
|
|
5126
5137
|
const o = `${e} ${s.join(" ")}`;
|
|
5127
5138
|
t !== void 0 && K(`${t} - exec(${o})`);
|
|
5128
|
-
const { stdout:
|
|
5129
|
-
a === void 0 ?
|
|
5139
|
+
const { stdout: l, stderr: d } = await or(o);
|
|
5140
|
+
a === void 0 ? l.trim() && console.log(l.trim()) : await at.writeFile(a, l.trim(), "utf8"), d.trim() && console.error(d.trim());
|
|
5130
5141
|
}
|
|
5131
|
-
async function
|
|
5142
|
+
async function ur(t, e) {
|
|
5132
5143
|
return at.readdir(t, e);
|
|
5133
5144
|
}
|
|
5145
|
+
function Ui(t) {
|
|
5146
|
+
const e = nr.find((s) => t.startsWith(s.idPrefix));
|
|
5147
|
+
if (!e) throw new Error(`Failed to locate module type configuration for identifier '${t}'.`);
|
|
5148
|
+
return e;
|
|
5149
|
+
}
|
|
5134
5150
|
async function Ve() {
|
|
5135
5151
|
}
|
|
5136
5152
|
function xt(t) {
|
|
@@ -5148,13 +5164,13 @@ function K(t) {
|
|
|
5148
5164
|
${t}
|
|
5149
5165
|
`);
|
|
5150
5166
|
}
|
|
5151
|
-
async function
|
|
5167
|
+
async function Q(t) {
|
|
5152
5168
|
return JSON.parse(await at.readFile(t, "utf8"));
|
|
5153
5169
|
}
|
|
5154
5170
|
async function At(t) {
|
|
5155
5171
|
return await at.readFile(t, "utf8");
|
|
5156
5172
|
}
|
|
5157
|
-
async function
|
|
5173
|
+
async function cr(t) {
|
|
5158
5174
|
try {
|
|
5159
5175
|
await at.unlink(t);
|
|
5160
5176
|
} catch (e) {
|
|
@@ -5162,23 +5178,23 @@ async function hr(t) {
|
|
|
5162
5178
|
}
|
|
5163
5179
|
}
|
|
5164
5180
|
async function dt(t, e, s = [], a = !1) {
|
|
5165
|
-
return K(`${t} - spawn(${e} ${s.join(" ")})`), new Promise((o,
|
|
5166
|
-
|
|
5167
|
-
v === 0 || a ? o() :
|
|
5181
|
+
return K(`${t} - spawn(${e} ${s.join(" ")})`), new Promise((o, l) => {
|
|
5182
|
+
as(e, s, { stdio: "inherit" }).on("close", (v) => {
|
|
5183
|
+
v === 0 || a ? o() : l(new Error(`${e} exited with code ${v}`));
|
|
5168
5184
|
});
|
|
5169
5185
|
});
|
|
5170
5186
|
}
|
|
5171
|
-
function
|
|
5172
|
-
const o = t.indexOf(s),
|
|
5173
|
-
if (o === -1 ||
|
|
5187
|
+
function qi(t, e, s, a) {
|
|
5188
|
+
const o = t.indexOf(s), l = t.indexOf(a);
|
|
5189
|
+
if (o === -1 || l === -1) throw new Error(`Markers ${s}-${a} not found in content.`);
|
|
5174
5190
|
return `${t.slice(0, Math.max(0, o + s.length))}
|
|
5175
5191
|
${e}
|
|
5176
|
-
${t.slice(Math.max(0,
|
|
5192
|
+
${t.slice(Math.max(0, l))}`;
|
|
5177
5193
|
}
|
|
5178
5194
|
async function oe(t, e) {
|
|
5179
5195
|
await at.writeFile(t, JSON.stringify(e, void 0, 4), "utf8");
|
|
5180
5196
|
}
|
|
5181
|
-
async function
|
|
5197
|
+
async function Gt(t, e) {
|
|
5182
5198
|
await at.writeFile(t, e, "utf8");
|
|
5183
5199
|
}
|
|
5184
5200
|
function Ae(t, e) {
|
|
@@ -5187,15 +5203,15 @@ function Ae(t, e) {
|
|
|
5187
5203
|
if (["loc", "range", "start", "end", "comments"].includes(s)) continue;
|
|
5188
5204
|
const o = a;
|
|
5189
5205
|
if (Array.isArray(o))
|
|
5190
|
-
for (const
|
|
5191
|
-
const d =
|
|
5206
|
+
for (const l of o) {
|
|
5207
|
+
const d = l;
|
|
5192
5208
|
d && typeof d.type == "string" && Ae(d, e);
|
|
5193
5209
|
}
|
|
5194
5210
|
else o && typeof o == "object" && typeof o.type == "string" && Ae(o, e);
|
|
5195
5211
|
}
|
|
5196
5212
|
}
|
|
5197
|
-
async function
|
|
5198
|
-
const t = await
|
|
5213
|
+
async function pr() {
|
|
5214
|
+
const t = await Q("config.json"), e = {
|
|
5199
5215
|
body: JSON.stringify(t),
|
|
5200
5216
|
headers: { "Content-Type": "application/json" },
|
|
5201
5217
|
method: "PUT"
|
|
@@ -5212,59 +5228,46 @@ async function ii(t) {
|
|
|
5212
5228
|
}
|
|
5213
5229
|
async function si(t, e) {
|
|
5214
5230
|
const s = `v${t.version}`;
|
|
5215
|
-
async function a(o,
|
|
5216
|
-
const d = await
|
|
5231
|
+
async function a(o, l = "") {
|
|
5232
|
+
const d = await ur(o, { withFileTypes: !0 });
|
|
5217
5233
|
for (const v of d) {
|
|
5218
|
-
const g = `${o}/${v.name}`, h =
|
|
5234
|
+
const g = `${o}/${v.name}`, h = l ? `${l}/${v.name}` : v.name;
|
|
5219
5235
|
if (v.isDirectory()) continue;
|
|
5220
|
-
const P = `${e}_${s}/${h}`.replaceAll("\\", "/"), N = v.name.endsWith(".css") ? "text/css" : "application/octet-stream",
|
|
5221
|
-
console.info(`⚙️ Uploading '${h}' → '${P}'...`), await ct(void 0, `wrangler r2 object put "${P}" --file="${g}" --content-type ${
|
|
5236
|
+
const P = `${e}_${s}/${h}`.replaceAll("\\", "/"), N = v.name.endsWith(".css") ? "text/css" : "application/octet-stream", j = v.name.endsWith(".js") ? "application/javascript" : N;
|
|
5237
|
+
console.info(`⚙️ Uploading '${h}' → '${P}'...`), await ct(void 0, `wrangler r2 object put "${P}" --file="${g}" --content-type ${j} --jurisdiction=eu --remote`);
|
|
5222
5238
|
}
|
|
5223
5239
|
}
|
|
5224
5240
|
await a("dist");
|
|
5225
5241
|
}
|
|
5226
|
-
|
|
5227
|
-
{ idPrefix: "datapos-app-nuxt", typeId: "app", publish: !1, uploadGroupName: void 0 },
|
|
5228
|
-
{ idPrefix: "datapos-api", typeId: "api", publish: !1, uploadGroupName: void 0 },
|
|
5229
|
-
{ idPrefix: "datapos-connector", typeId: "connector", publish: !0, uploadGroupName: "connectors" },
|
|
5230
|
-
{ idPrefix: "datapos-context", typeId: "context", publish: !0, uploadGroupName: "contexts" },
|
|
5231
|
-
{ idPrefix: "datapos-development", typeId: "development", publish: !0, uploadGroupName: void 0 },
|
|
5232
|
-
{ idPrefix: "datapos-engine", typeId: "engine", publish: !1, uploadGroupName: "engine" },
|
|
5233
|
-
{ idPrefix: "datapos-presenter", typeId: "presenter", publish: !0, uploadGroupName: "presenters" },
|
|
5234
|
-
{ idPrefix: "datapos-resources", typeId: "resources", publish: !1, uploadGroupName: void 0 },
|
|
5235
|
-
{ idPrefix: "datapos-shared", typeId: "shared", publish: !0, uploadGroupName: void 0 },
|
|
5236
|
-
{ idPrefix: "datapos-tool", typeId: "tool", publish: !0, uploadGroupName: "tools" }
|
|
5237
|
-
];
|
|
5238
|
-
async function Rr() {
|
|
5242
|
+
async function Mr() {
|
|
5239
5243
|
try {
|
|
5240
5244
|
xt("Build Project"), await dt("1️⃣ Bundle project", "vite", ["build"]), St("Project built.");
|
|
5241
5245
|
} catch (t) {
|
|
5242
5246
|
console.error("❌ Error building project.", t), process.exit(1);
|
|
5243
5247
|
}
|
|
5244
5248
|
}
|
|
5245
|
-
async function
|
|
5249
|
+
async function Dr() {
|
|
5246
5250
|
try {
|
|
5247
5251
|
xt("Release Project"), await Ve();
|
|
5248
|
-
const t = await
|
|
5249
|
-
let e = await
|
|
5250
|
-
await
|
|
5251
|
-
const s =
|
|
5252
|
-
if (!s) throw new Error(`Failed to locate module type configuration for identifier '${e.id}'.`);
|
|
5252
|
+
const t = await Q("package.json");
|
|
5253
|
+
let e = await Q("config.json");
|
|
5254
|
+
await Hi("1️⃣", t);
|
|
5255
|
+
const s = Ui(e.id);
|
|
5253
5256
|
switch (s.typeId) {
|
|
5254
5257
|
case "connector":
|
|
5255
|
-
e = await
|
|
5258
|
+
e = await fr("2️⃣", t);
|
|
5256
5259
|
break;
|
|
5257
5260
|
case "context":
|
|
5258
|
-
e = await
|
|
5261
|
+
e = await dr("2️⃣", t);
|
|
5259
5262
|
break;
|
|
5260
5263
|
case "presenter":
|
|
5261
|
-
e = await
|
|
5264
|
+
e = await mr("2️⃣", t);
|
|
5262
5265
|
break;
|
|
5263
5266
|
default:
|
|
5264
|
-
e = await
|
|
5267
|
+
e = await lr("2️⃣", t);
|
|
5265
5268
|
}
|
|
5266
5269
|
if (await dt("3️⃣ Bundle project", "vite", ["build"]), await ct("4️⃣ Stage changes", "git", ["add", "."]), await ct("5️⃣ Commit changes", "git", ["commit", "-m", `"v${t.version}"`]), await ct("6️⃣ Push changes", "git", ["push", "origin", "main:main"]), s.typeId === "app")
|
|
5267
|
-
K("7️⃣ Register module"), await
|
|
5270
|
+
K("7️⃣ Register module"), await pr();
|
|
5268
5271
|
else if (s.typeId === "engine")
|
|
5269
5272
|
K("7️⃣ Register module"), await si(t, `datapos-engine-eu/${s.uploadGroupName}`), await ii(e);
|
|
5270
5273
|
else if (s.uploadGroupName === void 0)
|
|
@@ -5274,13 +5277,13 @@ async function Mr() {
|
|
|
5274
5277
|
const a = e.id.split("-").slice(2).join("-");
|
|
5275
5278
|
await si(t, `datapos-engine-eu/${s.uploadGroupName}/${a}`), await ii(e);
|
|
5276
5279
|
}
|
|
5277
|
-
if (s.
|
|
5280
|
+
if (s.isPublish) {
|
|
5278
5281
|
const a = ".npmrc";
|
|
5279
5282
|
try {
|
|
5280
|
-
await
|
|
5283
|
+
await Gt(a, `registry=https://registry.npmjs.org/
|
|
5281
5284
|
//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN ?? ""}`), await dt("8️⃣ Publish to npm", "npm", ["publish", "--access", "public"]);
|
|
5282
5285
|
} finally {
|
|
5283
|
-
await
|
|
5286
|
+
await cr(a);
|
|
5284
5287
|
}
|
|
5285
5288
|
} else
|
|
5286
5289
|
K(`8️⃣ Publishing NOT required for package with type identifier of '${s.typeId}'.`);
|
|
@@ -5289,16 +5292,16 @@ async function Mr() {
|
|
|
5289
5292
|
console.error("❌ Error releasing project.", t), process.exit(1);
|
|
5290
5293
|
}
|
|
5291
5294
|
}
|
|
5292
|
-
async function
|
|
5295
|
+
async function Vr() {
|
|
5293
5296
|
try {
|
|
5294
5297
|
xt("Synchronise Project with GitHub");
|
|
5295
|
-
const t = await
|
|
5296
|
-
K("Bump project version"), await
|
|
5298
|
+
const t = await Q("package.json");
|
|
5299
|
+
K("Bump project version"), await Hi("1️⃣", t), await ct("2️⃣ Stage changes", "git", ["add", "."]), await ct("3️⃣ Commit changes", "git", ["commit", "-m", `"v${t.version}"`]), await ct("4️⃣ Push changes", "git", ["push", "origin", "main:main"]), St(`Project version '${t.version}' synchronised with GitHub.`);
|
|
5297
5300
|
} catch (t) {
|
|
5298
5301
|
console.error("❌ Error synchronising project with GitHub.", t), process.exit(1);
|
|
5299
5302
|
}
|
|
5300
5303
|
}
|
|
5301
|
-
function
|
|
5304
|
+
function Fr() {
|
|
5302
5305
|
try {
|
|
5303
5306
|
xt("Test Project"), console.error(`
|
|
5304
5307
|
❌ No tests implemented.
|
|
@@ -5307,39 +5310,39 @@ function Vr() {
|
|
|
5307
5310
|
console.error("❌ Error testing project.", t), process.exit(1);
|
|
5308
5311
|
}
|
|
5309
5312
|
}
|
|
5310
|
-
async function
|
|
5313
|
+
async function lr(t, e) {
|
|
5311
5314
|
K(`${t} Build project configuration`);
|
|
5312
|
-
const s = await
|
|
5315
|
+
const s = await Q("config.json");
|
|
5313
5316
|
return e.name != null && (s.id = e.name.replace("@datapos/", "").replace("@data-positioning/", "")), e.version != null && (s.version = e.version), await oe("config.json", s), s;
|
|
5314
5317
|
}
|
|
5315
|
-
async function
|
|
5318
|
+
async function fr(t, e) {
|
|
5316
5319
|
K(`${t} Build connector project configuration`);
|
|
5317
|
-
const [s, a] = await Promise.all([
|
|
5320
|
+
const [s, a] = await Promise.all([Q("config.json"), At("src/index.ts")]), o = /* @__PURE__ */ Ee(Zi, s);
|
|
5318
5321
|
if (!o.success)
|
|
5319
5322
|
throw console.error("❌ Configuration is invalid:"), console.table(o.issues), new Error("Configuration is invalid.");
|
|
5320
|
-
const
|
|
5321
|
-
return await Fe(e, s,
|
|
5323
|
+
const l = De(a), d = yr(l);
|
|
5324
|
+
return await Fe(e, s, l, d);
|
|
5322
5325
|
}
|
|
5323
5326
|
async function Fe(t, e, s, a) {
|
|
5324
5327
|
return s.length > 0 ? (console.info(`ℹ️ Implements ${s.length} operations:`), console.table(s)) : console.warn("⚠️ Implements no operations."), a === "unknown" ? console.warn("⚠️ No usage identified.") : console.info(`ℹ️ Supports '${a}' usage.`), t.name != null && (e.id = t.name.replace("@datapos/", "").replace("@data-positioning/", "")), t.version != null && (e.version = t.version), e.operations = s, e.usageId = a, await oe("config.json", e), e;
|
|
5325
5328
|
}
|
|
5326
|
-
async function
|
|
5329
|
+
async function dr(t, e) {
|
|
5327
5330
|
K(`${t} Build context project configuration`);
|
|
5328
|
-
const [s, a] = await Promise.all([
|
|
5331
|
+
const [s, a] = await Promise.all([Q("config.json"), At("src/index.ts")]), o = /* @__PURE__ */ Ee(Yi, s);
|
|
5329
5332
|
if (!o.success)
|
|
5330
5333
|
throw console.error("❌ Configuration is invalid:"), console.table(o.issues), new Error("Configuration is invalid.");
|
|
5331
|
-
const
|
|
5332
|
-
return await Fe(e, s,
|
|
5334
|
+
const l = De(a);
|
|
5335
|
+
return await Fe(e, s, l);
|
|
5333
5336
|
}
|
|
5334
|
-
async function
|
|
5337
|
+
async function mr(t, e) {
|
|
5335
5338
|
K(`${t} Build presenter project configuration`);
|
|
5336
|
-
const [s, a] = await Promise.all([
|
|
5339
|
+
const [s, a] = await Promise.all([Q("config.json"), At("src/index.ts")]), o = /* @__PURE__ */ Ee(is, s);
|
|
5337
5340
|
if (!o.success)
|
|
5338
5341
|
throw console.error("❌ Configuration is invalid:"), console.table(o.issues), new Error("Configuration is invalid.");
|
|
5339
|
-
const
|
|
5340
|
-
return await Fe(e, s,
|
|
5342
|
+
const l = De(a);
|
|
5343
|
+
return await Fe(e, s, l);
|
|
5341
5344
|
}
|
|
5342
|
-
async function
|
|
5345
|
+
async function Hi(t, e, s = "./") {
|
|
5343
5346
|
if (K(`${t} Bump project version`), e.version == null)
|
|
5344
5347
|
e.version = "0.0.001", console.warn(`⚠️ Project version initialised to '${e.version}'.`), await oe(`${s}package.json`, e);
|
|
5345
5348
|
else {
|
|
@@ -5347,24 +5350,24 @@ async function qi(t, e, s = "./") {
|
|
|
5347
5350
|
e.version = `${o[0]}.${o[1]}.${Number(o[2]) + 1}`, console.info(`Project version bumped from '${a}' to '${e.version}'.`), await oe(`${s}package.json`, e);
|
|
5348
5351
|
}
|
|
5349
5352
|
}
|
|
5350
|
-
function
|
|
5353
|
+
function yr(t) {
|
|
5351
5354
|
let e = !1, s = !1;
|
|
5352
5355
|
for (const a of t)
|
|
5353
|
-
|
|
5356
|
+
ts.includes(a) && (e = !0), es.includes(a) && (s = !0);
|
|
5354
5357
|
return e && s ? "bidirectional" : e ? "source" : s ? "destination" : "unknown";
|
|
5355
5358
|
}
|
|
5356
|
-
const
|
|
5359
|
+
const xr = {
|
|
5357
5360
|
critical: { color: "D32F2F", label: "critical" },
|
|
5358
5361
|
high: { color: "EF6C00", label: "high" },
|
|
5359
5362
|
moderate: { color: "FBC02D", label: "moderate" },
|
|
5360
5363
|
low: { color: "6D8C31", label: "low" },
|
|
5361
5364
|
unknown: { color: "616161", label: "unknown" }
|
|
5362
5365
|
// See sample badges in ~/tests/sampleBadges.md. Also included 'info' colouring.
|
|
5363
|
-
},
|
|
5364
|
-
async function
|
|
5366
|
+
}, vr = "<!-- OWASP_BADGES_START -->", gr = "<!-- OWASP_BADGES_END -->";
|
|
5367
|
+
async function jr() {
|
|
5365
5368
|
try {
|
|
5366
5369
|
xt("Audit Dependencies"), await Ve();
|
|
5367
|
-
const t = await
|
|
5370
|
+
const t = await Q("package.json");
|
|
5368
5371
|
await dt("1️⃣", "owasp-dependency-check", [
|
|
5369
5372
|
"--out",
|
|
5370
5373
|
"dependency-check-reports",
|
|
@@ -5374,32 +5377,32 @@ async function Fr() {
|
|
|
5374
5377
|
"--nodePackageSkipDevDependencies",
|
|
5375
5378
|
"--nvdApiKey",
|
|
5376
5379
|
process.env.OWASP_NVD_API_KEY ?? ""
|
|
5377
|
-
]), await
|
|
5380
|
+
]), await br("2️⃣"), await dt("3️⃣ Check using 'npm audit'", "npm", ["audit"]), St("Dependencies audited.");
|
|
5378
5381
|
} catch (t) {
|
|
5379
5382
|
console.error("❌ Error auditing dependencies.", t), process.exit(1);
|
|
5380
5383
|
}
|
|
5381
5384
|
}
|
|
5382
|
-
async function
|
|
5385
|
+
async function br(t) {
|
|
5383
5386
|
K(`${t} Insert OWASP Badge(s) into 'README.md'`);
|
|
5384
|
-
const e = await
|
|
5387
|
+
const e = await Q("dependency-check-reports/dependency-check-report.json"), s = { critical: 0, high: 0, moderate: 0, low: 0, unknown: 0 };
|
|
5385
5388
|
for (const d of e.dependencies)
|
|
5386
5389
|
if (d.vulnerabilities != null)
|
|
5387
5390
|
for (const v of d.vulnerabilities) {
|
|
5388
5391
|
const g = v.severity?.toLowerCase() ?? "unknown";
|
|
5389
5392
|
g in s ? s[g]++ : s.unknown++;
|
|
5390
5393
|
}
|
|
5391
|
-
const a = await
|
|
5392
|
-
await
|
|
5394
|
+
const a = await Tr(s), o = await At("./README.md"), l = qi(o, a.join(" "), vr, gr);
|
|
5395
|
+
await Gt("README.md", l), console.info("OWASP audit badge(s) inserted into 'README.md'");
|
|
5393
5396
|
}
|
|
5394
|
-
async function
|
|
5395
|
-
const e = await
|
|
5396
|
-
if (Object.values(t).reduce((o,
|
|
5397
|
+
async function Tr(t) {
|
|
5398
|
+
const e = await Q("config.json"), s = [];
|
|
5399
|
+
if (Object.values(t).reduce((o, l) => o + l, 0) === 0)
|
|
5397
5400
|
console.info("No vulnerabilities found."), s.push(`[](https://data-positioning.github.io/${e.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
5398
5401
|
else
|
|
5399
|
-
for (const [o,
|
|
5400
|
-
const d =
|
|
5401
|
-
if (console.warn(`⚠️ ${
|
|
5402
|
-
const v = `https://img.shields.io/badge/OWASP-${
|
|
5402
|
+
for (const [o, l] of Object.entries(t)) {
|
|
5403
|
+
const d = xr[o];
|
|
5404
|
+
if (console.warn(`⚠️ ${l} ${d.label} vulnerability(ies) found.`), l === 0) continue;
|
|
5405
|
+
const v = `https://img.shields.io/badge/OWASP-${l}%20${d.label}-${d.color}`;
|
|
5403
5406
|
s.push(`[](https://data-positioning.github.io/${e.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
5404
5407
|
}
|
|
5405
5408
|
return s;
|
|
@@ -5411,11 +5414,11 @@ async function Br() {
|
|
|
5411
5414
|
console.error("❌ Error checking dependencies.", t), process.exit(1);
|
|
5412
5415
|
}
|
|
5413
5416
|
}
|
|
5414
|
-
const
|
|
5415
|
-
async function
|
|
5417
|
+
const Sr = "<!-- DEPENDENCY_LICENSES_START -->", Pr = "<!-- DEPENDENCY_LICENSES_END -->";
|
|
5418
|
+
async function Ur(t = [], e = !0) {
|
|
5416
5419
|
try {
|
|
5417
5420
|
xt("Document Dependencies"), await Ve();
|
|
5418
|
-
const s = t.flatMap((o) => ["--allowed", `'${o}'`]), a = ri(new
|
|
5421
|
+
const s = t.flatMap((o) => ["--allowed", `'${o}'`]), a = ri(new ns(import.meta.resolve("@datapos/datapos-development/license-report-config")));
|
|
5419
5422
|
await ct(
|
|
5420
5423
|
"1️⃣ Generate 'licenses.json' file",
|
|
5421
5424
|
"license-report",
|
|
@@ -5426,7 +5429,7 @@ async function jr(t = [], e = !0) {
|
|
|
5426
5429
|
"license-report-recursive",
|
|
5427
5430
|
["--only=prod,peer", "--output=tree", "--recurse", "--department.value=n/a", "--licensePeriod.value=n/a", "--material.value=n/a", "--relatedTo.value=n/a"],
|
|
5428
5431
|
"licenses/licenseTree.json"
|
|
5429
|
-
), await ct("4️⃣ Check 'licenseTree.json' file", "license-report-check", ["--source", "licenses/licenseTree.json", "--output=table", ...s])) : (K("3️⃣ Skip 'licenses/licenseTree.json' file generate"), K("4️⃣ Skip 'licenses/licenseTree.json' file check")), await
|
|
5432
|
+
), await ct("4️⃣ Check 'licenseTree.json' file", "license-report-check", ["--source", "licenses/licenseTree.json", "--output=table", ...s])) : (K("3️⃣ Skip 'licenses/licenseTree.json' file generate"), K("4️⃣ Skip 'licenses/licenseTree.json' file check")), await hr("licenses/downloads"), await ct("5️⃣ Download license files", "license-downloader", [
|
|
5430
5433
|
"--source",
|
|
5431
5434
|
"licenses/licenses.json",
|
|
5432
5435
|
"--licDir",
|
|
@@ -5434,17 +5437,17 @@ async function jr(t = [], e = !0) {
|
|
|
5434
5437
|
"--githubToken.tokenEnvVar",
|
|
5435
5438
|
"GITHUB_TOKEN",
|
|
5436
5439
|
"--download"
|
|
5437
|
-
]), await
|
|
5440
|
+
]), await Cr("6️⃣", e), St("Dependencies documented.");
|
|
5438
5441
|
} catch (s) {
|
|
5439
5442
|
console.error("❌ Error documenting dependencies.", s), process.exit(1);
|
|
5440
5443
|
}
|
|
5441
5444
|
}
|
|
5442
|
-
async function
|
|
5445
|
+
async function Cr(t, e) {
|
|
5443
5446
|
K(`${t} Insert licenses into 'README.md'`);
|
|
5444
|
-
const s = await
|
|
5447
|
+
const s = await Q("licenses/licenses.json"), a = await Q("licenses/downloads/licenses.ext.json");
|
|
5445
5448
|
let o = [];
|
|
5446
|
-
e && (o = await
|
|
5447
|
-
const
|
|
5449
|
+
e && (o = await Q("licenses/licenseTree.json"));
|
|
5450
|
+
const l = [
|
|
5448
5451
|
...(() => {
|
|
5449
5452
|
const h = /* @__PURE__ */ new Map();
|
|
5450
5453
|
for (const P of s)
|
|
@@ -5463,16 +5466,16 @@ async function Pr(t, e) {
|
|
|
5463
5466
|
let d = `|Name|Type|Installed|Latest|Latest Released|Deps|Document|
|
|
5464
5467
|
|:-|:-|:-:|:-:|:-|-:|:-|
|
|
5465
5468
|
`;
|
|
5466
|
-
for (const h of
|
|
5467
|
-
const P = h.installedVersion === h.remoteVersion ? h.installedVersion : `${h.installedVersion} ⚠️`, N = h.latestRemoteModified ?
|
|
5469
|
+
for (const h of l) {
|
|
5470
|
+
const P = h.installedVersion === h.remoteVersion ? h.installedVersion : `${h.installedVersion} ⚠️`, N = h.latestRemoteModified ? kr(h.latestRemoteModified.split("T")[0]) : "n/a", j = h.dependencyCount != null && h.dependencyCount >= 0 ? h.dependencyCount : "n/a";
|
|
5468
5471
|
let nt;
|
|
5469
|
-
h.licenseFileLink == null || h.licenseFileLink == "" ? nt = "⚠️ No license file" : nt = `[${h.licenseFileLink.slice(Math.max(0, h.licenseFileLink.lastIndexOf("/") + 1))}](${h.licenseFileLink})`, d += `|${h.name}|${h.licenseType}|${P}|${h.remoteVersion}|${N}|${
|
|
5472
|
+
h.licenseFileLink == null || h.licenseFileLink == "" ? nt = "⚠️ No license file" : nt = `[${h.licenseFileLink.slice(Math.max(0, h.licenseFileLink.lastIndexOf("/") + 1))}](${h.licenseFileLink})`, d += `|${h.name}|${h.licenseType}|${P}|${h.remoteVersion}|${N}|${j}|${nt}|
|
|
5470
5473
|
`;
|
|
5471
5474
|
}
|
|
5472
|
-
const v = await At("./README.md"), g =
|
|
5473
|
-
await
|
|
5475
|
+
const v = await At("./README.md"), g = qi(v, d, Sr, Pr);
|
|
5476
|
+
await Gt("README.md", g), console.info("OWASP audit badge(s) inserted into 'README.md'"), await Gt("README.md", g);
|
|
5474
5477
|
}
|
|
5475
|
-
function
|
|
5478
|
+
function kr(t) {
|
|
5476
5479
|
if (t == null || t === "") return "n/a";
|
|
5477
5480
|
const e = t.split("T")[0];
|
|
5478
5481
|
if (e == null || e === "") return "n/a";
|
|
@@ -5480,44 +5483,54 @@ function Cr(t) {
|
|
|
5480
5483
|
let o = (a.getFullYear() - s.getFullYear()) * 12 + (a.getMonth() - s.getMonth());
|
|
5481
5484
|
return a.getDate() < s.getDate() && (o -= 1), o === 0 ? `this month: ${e}` : o === 1 ? `1 month ago: ${e}` : o <= 6 ? `${o} months ago: ${e}` : o <= 12 ? `${o} months ago: ${e} ⚠️` : `${o} months ago: ${e}❗`;
|
|
5482
5485
|
}
|
|
5483
|
-
async function
|
|
5486
|
+
async function qr() {
|
|
5484
5487
|
try {
|
|
5485
5488
|
xt("Format Code");
|
|
5486
|
-
const s = ["--write", "*.json", "*.md", "*.ts", ...["app", "src"].filter((a) =>
|
|
5489
|
+
const s = ["--write", "*.json", "*.md", "*.ts", ...["app", "src"].filter((a) => Qi(a)).map((a) => `${a}/**`)];
|
|
5487
5490
|
await dt("1️⃣ Format", "prettier", s), St("Code formatted.");
|
|
5488
5491
|
} catch (t) {
|
|
5489
5492
|
console.error("❌ Error formatting code.", t), process.exit(1);
|
|
5490
5493
|
}
|
|
5491
5494
|
}
|
|
5492
|
-
async function
|
|
5495
|
+
async function Hr() {
|
|
5493
5496
|
try {
|
|
5494
5497
|
xt("Lint Code"), await dt("1️⃣ Lint", "eslint", ["."]), St("Code linted.");
|
|
5495
5498
|
} catch (t) {
|
|
5496
5499
|
console.error("❌ Error linting code.", t), process.exit(1);
|
|
5497
5500
|
}
|
|
5498
5501
|
}
|
|
5499
|
-
const
|
|
5500
|
-
async function
|
|
5502
|
+
const wr = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣"];
|
|
5503
|
+
async function $r(t = []) {
|
|
5501
5504
|
try {
|
|
5502
5505
|
xt("Update '@datapos/datapos' Dependencies");
|
|
5503
5506
|
for (const [e, s] of t.entries()) {
|
|
5504
|
-
const a =
|
|
5505
|
-
|
|
5507
|
+
const a = wr.at(e) ?? "🔢";
|
|
5508
|
+
if (s === "eslint")
|
|
5509
|
+
await dt(`${a} Update '${s}'`, "npm", ["install", "@datapos/eslint-config-datapos@latest"]);
|
|
5510
|
+
else if (await dt(`${a} Update '${s}'`, "npm", ["install", `@datapos/datapos-${s}@latest`]), s === "development") {
|
|
5511
|
+
const o = await Q("config.json"), l = Ui(o.id);
|
|
5512
|
+
await Ar(l);
|
|
5513
|
+
}
|
|
5506
5514
|
}
|
|
5507
5515
|
St("'@datapos/datapos' dependencies updated.");
|
|
5508
5516
|
} catch (e) {
|
|
5509
5517
|
console.error("❌ Error updating '@datapos/datapos' dependencies.", e), process.exit(1);
|
|
5510
5518
|
}
|
|
5511
5519
|
}
|
|
5512
|
-
async function
|
|
5520
|
+
async function Ar(t) {
|
|
5521
|
+
console.log(1111, t);
|
|
5513
5522
|
const e = te.dirname(ri(import.meta.url));
|
|
5514
|
-
await
|
|
5523
|
+
await Ut(e, "../", ".editorconfig"), await Ut(e, "../", ".gitattributes"), await Ut(e, "../", ".markdownlint.json"), await Ut(e, "../", "LICENSE"), t.isPublish && await Ut(e, "../resources/published", ".gitignore");
|
|
5515
5524
|
}
|
|
5516
|
-
async function
|
|
5517
|
-
|
|
5525
|
+
async function Ut(t, e, s) {
|
|
5526
|
+
console.log(2222, t, e, s);
|
|
5527
|
+
const a = te.resolve(t, `${e}${s}`);
|
|
5528
|
+
console.log(3333, a);
|
|
5529
|
+
const o = await At(a), l = te.resolve(process.cwd(), s);
|
|
5530
|
+
console.log(4444, l);
|
|
5518
5531
|
let d;
|
|
5519
5532
|
try {
|
|
5520
|
-
d = await At(
|
|
5533
|
+
d = await At(l);
|
|
5521
5534
|
} catch (v) {
|
|
5522
5535
|
if (v.code !== "ENOENT") throw v;
|
|
5523
5536
|
}
|
|
@@ -5525,25 +5538,25 @@ async function Zt(t, e, s) {
|
|
|
5525
5538
|
console.info(`ℹ️ File '${s}' is already up to date.`);
|
|
5526
5539
|
return;
|
|
5527
5540
|
}
|
|
5528
|
-
await
|
|
5541
|
+
await Gt(l, o), console.info(`ℹ️ File '${s}' synchronised.`);
|
|
5529
5542
|
}
|
|
5530
|
-
async function
|
|
5543
|
+
async function Gr(t) {
|
|
5531
5544
|
try {
|
|
5532
5545
|
console.info(`🚀 Building public directory index for identifier '${t}'...`);
|
|
5533
5546
|
const e = {};
|
|
5534
|
-
async function s(o,
|
|
5547
|
+
async function s(o, l) {
|
|
5535
5548
|
console.info(`⚙️ Processing directory '${o}'...`);
|
|
5536
5549
|
const d = [], v = o.slice(`public/${t}`.length);
|
|
5537
5550
|
e[v === "" ? "/" : v] = d;
|
|
5538
|
-
for (const g of
|
|
5551
|
+
for (const g of l) {
|
|
5539
5552
|
const h = `${o}/${g}`;
|
|
5540
5553
|
try {
|
|
5541
5554
|
const P = await at.stat(h);
|
|
5542
5555
|
if (P.isDirectory()) {
|
|
5543
|
-
const N = await at.readdir(h),
|
|
5544
|
-
d.push(
|
|
5556
|
+
const N = await at.readdir(h), j = { childCount: N.length, name: g, typeId: "folder" };
|
|
5557
|
+
d.push(j), await s(h, N);
|
|
5545
5558
|
} else {
|
|
5546
|
-
const N = { id:
|
|
5559
|
+
const N = { id: Ji(), lastModifiedAt: P.mtimeMs, name: g, size: P.size, typeId: "object" };
|
|
5547
5560
|
d.push(N);
|
|
5548
5561
|
}
|
|
5549
5562
|
} catch (P) {
|
|
@@ -5562,16 +5575,16 @@ async function $r(t) {
|
|
|
5562
5575
|
}
|
|
5563
5576
|
}
|
|
5564
5577
|
export {
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5578
|
+
jr as auditDependencies,
|
|
5579
|
+
Gr as buildDirectoryIndex,
|
|
5580
|
+
Mr as buildProject,
|
|
5568
5581
|
Br as checkDependencies,
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5582
|
+
Ur as documentDependencies,
|
|
5583
|
+
qr as formatCode,
|
|
5584
|
+
Hr as lintCode,
|
|
5585
|
+
Dr as releaseProject,
|
|
5586
|
+
Vr as syncProjectWithGitHub,
|
|
5587
|
+
Fr as testProject,
|
|
5588
|
+
$r as updateDataPosDependencies
|
|
5576
5589
|
};
|
|
5577
5590
|
//# sourceMappingURL=datapos-development.es.js.map
|